Hi all,
I get strange outputs from my email function. My code:
//START
$headers = "From: Richard <richard@email.com>\n";
$headers .= 'Bcc: richard@email.com' . "\r\n";
$headers .= "Return-Path: <richard@email.com>\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: text/HTML; charset=ISO-8859-1\n";
$subject = 'email confirmation';
$to = $email;
$body .= " * Melbourne: (03) 9000 0000<br>";
$body .= " * Newcastle: (02) 9000 0000<br>";
$body .= " * Perth: (08) 9000 0000<br>";
$body .= " * Rockhampton: (07) 9000 00000<br>";
$body .= " * Sydney: (02) 9000 0000<br>";
mail($to, $subject, $body, $headers, "-f richard@email.com");
//END
For some reason, it generates the email perfectly fine in several instances, but then it gives something like "* Melbourne: (03) 9000 00 00" in the output -- i.e. it adds a space between the four 0's. In another instance, the "<br>" tag was displayed. I'm viewing all of these emails from Gmail and can't understand why it's not consistent?
Any pointers, suggestions etc would be great.
Thanks in advance!
Using mail function
Moderator: General Moderators
Re: Using mail function
Could have something to do with the improper headers. They should have a \r\n between each - like you did with Bcc.