0
votes

First, sorry if my English is bad, I'm French.

I have some trouble with PHP mail() function and the Lotus Notes client: I try to send an HTML email to my professional address, this using Lotus Notes, but it seems that it does not recognize HTML at all. Instead, it shows me the code of my email with the Courier New font...

Here is my code, very simple:

$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=utf-8\r\n";
$headers .= "From: Bidouille <[email protected]>\r\n";
$headers .= "X-Mailer: PHP/".phpversion()."\r\n";

$mail = "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam sed mauris at justo pretium malesuada. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean faucibus nisl a malesuada pulvinar. Aliquam suscipit aliquam mauris, nec aliquet erat feugiat eu.</p>";

mail("[email protected]", "Test", $mail, $headers);

And here is the mail I get on Lotus Notes:

Content-Type: text/html; charset=utf-8

From: Bidouille

X-Mailer: PHP/5.2.9

Message-Id: <[email protected]> Date: Tue, 18 Feb 2014 15:19:05 +0100 (CET)

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam sed mauris at justo pretium malesuada. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean faucibus nisl a malesuada pulvinar. Aliquam suscipit aliquam mauris, nec aliquet erat feugiat eu.

Do you have any idea about what happens?

Thanks for your answers.

1

1 Answers

1
votes

Try using \n instead of \r\n for separating headers. Here is the quote from php.net/mail:

If messages are not received, try using a LF (\n) only. Some Unix mail transfer agents (most notably » qmail) replace LF by CRLF automatically (which leads to doubling CR if CRLF is used). This should be a last resort, as it does not comply with » RFC 2822.

And a doubled CRLF means end of headers.