Greetings,
I am having issues with the mail() function when sending an html formatted e-mail.
The code sending the message is:
"
$subject = "New Equipment Posting on XXXXXX.org Website";
$message = '<html><body>Hello, <p>A new item has been added for Sale on the XXXXXXXX.org website. You can view the item <a href=[0].'>here</a>. <p> Thank You</body></html>';
$newLine = "\r\n";
$headers = "MIME-Version: 1.0" . $newLine;
$headers .= "Content-type: text/html; charset=iso-8859-1" . $newLine;
$headers .=" TO: XXXXXXXXXX.org <XXXXXX@XXXXX.org>" . $newLine;
$headers .= "From: XXXXXXXX.org <XXXXXX@XXXXX.org>" . $newLine;
mail($to, $subject, $message, $headers);
header("Location: thankyou.php");
"
When I receive this e-mail (Using Thunderbird, Hostway SMTP) it comes in formatted correctly.
I also receive this e-mail to my gmail account correctly.
Some recipients are receiving it with no From, and not as html, but text with all the html tags.
I know there is an issue with my header, but I have been unable to discover what it is.
Thanks!
Rick
I am having issues with the mail() function when sending an html formatted e-mail.
The code sending the message is:
"
$subject = "New Equipment Posting on XXXXXX.org Website";
$message = '<html><body>Hello, <p>A new item has been added for Sale on the XXXXXXXX.org website. You can view the item <a href=[0].'>here</a>. <p> Thank You</body></html>';
$newLine = "\r\n";
$headers = "MIME-Version: 1.0" . $newLine;
$headers .= "Content-type: text/html; charset=iso-8859-1" . $newLine;
$headers .=" TO: XXXXXXXXXX.org <XXXXXX@XXXXX.org>" . $newLine;
$headers .= "From: XXXXXXXX.org <XXXXXX@XXXXX.org>" . $newLine;
mail($to, $subject, $message, $headers);
header("Location: thankyou.php");
"
When I receive this e-mail (Using Thunderbird, Hostway SMTP) it comes in formatted correctly.
I also receive this e-mail to my gmail account correctly.
Some recipients are receiving it with no From, and not as html, but text with all the html tags.
I know there is an issue with my header, but I have been unable to discover what it is.
Thanks!
Rick