Php mail newline problem
Posted: Sun Jun 19, 2005 2:40 am
Hi, I got a functional mail script. I can see no problem with it except that when I try to open the email relayed from my system to my yahoo inbox, the output isn't quite as what is expected... For example I typed this in the textarea
This \r \n is \r \n a \r \n test \r \n !
Uh... any help would be appreciated... And one more thing, I find that my e-mail is always stored in the bulk folder rather than my inbox...
Here's the code...
JCART | Please use
the output should be...This
is
a
test
!
well... it doesn't display like that... But instead...This
is
a
test
!
This \r \n is \r \n a \r \n test \r \n !
Uh... any help would be appreciated... And one more thing, I find that my e-mail is always stored in the bulk folder rather than my inbox...
Here's the code...
Code: Select all
ini_set("SMTP","localhost");
ini_set("smtp_port","26");
ini_set("sendmail_from","admin@localhost.com");
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "X-Priority: 3\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: php\n";
$headers .= "From: \"".$n."\" <".$e.">\n";
if (mail("netboysbe@yahoo.com",$s,$m,$headers))
{
$message.="<center><p>Success!</p></center>";
}
else
{
$message.="<center><p>The following errors occured!</p></center>";
$errmessage.='<p>Unable to send message.</p>';
}Code: Select all
tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]