I'm sending mail using the mail() function. For some reason, in messages sent to AOL recipients, headers below a certain point are showing up in the body of the message. I'm wondering if there's something in there I've messed up.
My headers look like this:
$this->email_header = "From: Joe Schmoe <sender@mydomain.com>\r\n";
$this->email_header .= "Reply-To: [email]sender@mydomain.com[/email]\r\n";
$this->email_header .= "Sender: Joe Schmoe <sender@mydomain.com>\r\n";
$this->email_header .= "Return-Path: [email]sender@mydomain.com[/email] \r\n";
$this->email_header .= "Organization: My Org\r\n";
$this->email_header .= "Date: March 2, 2005\r\n";
$this->email_header .= "X-Sender: Joe Schmoe <sender@mydomain.com>\r\n";
$this->email_header .= "X-Priority: 3\r\n";
$this->email_header .= "X-MSMail-Priority: Normal\r\n";
$this->email_header .= "X-Mailer: php\r\n";
$this->email_header .= "MIME-Version: 1.0\r\n";
$this->email_header .= "Content-Transfer-Encoding: 7bit\r\n";
$this->email_header .= "Content-Type: text/plain; charset=iso-8859-1\r\n";
Everything starting with the Date is visible at the top of the message body, and is NOT in the message header.
I've tried commenting out the date line, and then I just see everything starting with the X-Priority line. Also tried rearranging the lines, adding a space before the "\r\n" - I've been messing with this for well over a day now and I'm running out of permutations to try.
Obviously I must be formatting something badly - can anyone tell me what's wrong? Or point me to an "email headers best practices" page out there somewhere?