I have a page that, after processing massive amounts of user-input, emails a confirmation email to both the user and the system admin.
The email to the system admin renders fine in all the clients I have browsed it in. However the email to the user does not render at all, it is just plain text.
The odd thing is that they both use the exact same headers array...
PHP Code:
$headers = array();
$headers[0] = 'MIME-Version: 1.0';
$headers[1] = 'Content-type: text/html; charset=utf-8';
$headers[2] = 'Content-Transfer-Encoding: 8bit';
$headers[3] = "From: no-reply@****.com";
$headers[4] = "Bcc: archive@****.com";
$headers[5] = "Reply-To: no-reply@****.com";
$headers[6] = "X-Mailer: PHP/".phpversion();
Here is the portion of the code that sends the emails. The only difference is that the email to the user has a "Thank You" amended to the end of the subject line.
PHP Code:
if(!mail($to, $subject, $message, implode("\r\n", $headers))){
// Does error catching stuff - irrelevant
}else{
mail($email, $subject.' Thank You!', $message, implode("\r\n", $headers));
}
This is extremely baffling... I have declared the doctype as HTML in both the email body and in the email header... The first email sent renders fine, the second renders as plain text.
EDIT::
I found the cause behind this. Poorly written email clients...