the mail() example on seems to be broken

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I needed a simple way to send out some mail, so I went to
and copied their example code:

The form I used to compose the email was different from the
example, but in terms of formatting the headers, the code is nearly

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: $returnAddress \r\n" ;
$success = mail($thisEmail, $emailSubject, $emailMainContent,

I sent this out. But several (not all) of the receipents tell me that
instead of HTML mail, they got mail with visible <br> tags

Re: the mail() example on seems to be broken

lawrence k wrote:

Quoted text here. Click to load it


That is hard to tell without knowing the content of $emailMainContent.
Maybe you changed somewhere in the process the content?
Maybe htmlentities() ?

Also, have a look at and search for helperpackages for  
sending HTML-mail.

Erwin Moller

Site Timeline