Jul 27 20:21:34 myMac postfix/smtp[10888]: CED002D04DD: to=,
relay=mydomain.com[xxx.xxx.xxx.xxx], delay=1036, status=deferred
(lost connection with mydomain.com[xxx.xxx.xxx.xxx] while sending
MAIL FROM)
The problem is that, by default, Postfix uses the RendezVous (nee OpenTalk) .local top level domain, which is, as far as internet hosts go, invalid. Basically, Postfix is trying to send email from www@yourmac.local (www being the user PHP is being executed by, if it's running as an Apache module).
So here's the trick: edit the file /private/etc/postfix/main.cf, and change the myhostname parameter to a valid domain name you control. Then restart Postfix (sudo postfix reload) and you're done. You can now use the mail() function in PHP.
[robg adds: A much older hint discussed PHP and sendmail, but we haven't covered postfix and PHP before, I don't believe...]

