Html mail() sending as plain text

Hey all,

I am trying to send an html email but the mail arrives in plain text.
Below is a sample of the code, what’s going wrong?

$to = “”;
$subject = “SUBJECT”;
$message = “MESSAGE”;
$headers = ‘MIME-Version: 1.0’ . "\r
$headers .= ‘Content-type: text/html; charset=iso-8859-1’ . "\r
$headers .= ‘From: Mailer <>’ . "\r
mail($to, $subject, $message, $headers);

The weirdest thing, the script in mention works on other servers :stuck_out_tongue:
WTF incorrect config is running on the server where it doesn’t work?!

Seeing as I’m the only one posting on this thread, I may as well answer it and finish it all off! haha

The problem is when sending through a QMAIL server, there is a bug in PHP and "\r
" should be replaced with "
" only.

This resolves the problem.

There is a quick writeup of this here.

Glad to see you’ve solved it and thank you for posting the solution for others to read :slight_smile: