We’ve recently upgraded to a Plesk Parallel Linux Server and it appears as if the PHP settings are ignoring headers! The emails are receiving fine, but display the HTML tags.
The phpInfo()
file can be viewed here: https://www.pressgofer.com/phpInfo.php
The PHP itself should be okay, but have included it here anyway.
PHP Mail Code
$email = "[email protected]";
$message = "<h1 style='font-family:Helvetica,Arial;font-size:17px'>Your account has a password reset request</h1>";
$headers = "From: [email protected] rn";
$headers .= "Reply-To: [email protected] rn";
$headers .= "MIME-Version: 1.0rn";
$headers .= "Content-Type: text/html; charset=ISO-8859-1rn";
mail($email, "Reset password notification", $message, $headers);
Many thanks,
Nick
2
Answers
sending mail from php: headers are interpreted as body?
Issue was associated with MIME type and server interpretation- no
r
needed.your
phpinfo
shows thatmail.add_x_header
is OFF. you need to turn it onTo enable the
X-Mail
header, setmail.add_x_header
to 1 in yourphp.ini