I've set up a local dev environment on snow leopard, and have set postfix up to send email via my isp mail server.
I eventually got postfix to work after much frustration, but now when my emails send the header information is bunged up!
I'm using the following php code:
$email = "me@mydomain"; $subject = "Email tester"; $body = "Simple test"; $header = "From: me@mydomain \r\n"; $header .= "MIME-VERSION: 1.0\r\n"; $header .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $phpversion = phpversion(); $header .= "X-Mailer: PHP v$phpversion\r\n"; mail($email,$subject,$body,$header); echo "message sent!";
The To: and Subject: headers display as they should, in the header!, but the rest display in the email body. This makes the email look like the from field in email client is empty.
I've tried a variety of php scripts, some very simple, but its the same thing, headers always displaying in the email body.
I'm thinking it could be a postfix problem, but not sure, anyone encountered this type of problem before?