Php mail issue
Posted: Thu Jun 17, 2010 12:50 am
Hi,
I have been stuck with an issue related to mail in php. Following is the code that I have used. In the message part I want to use line breaks. For that first I have tried with <br />. Then it was ok with gmail, yahoo such mails. But not with my company id. It is looking as such as the html part in message.
Then I have tried with \n. Then the reverse happened. Working well with my company id but not with gmail and yahoo etc. Expecting a solution for this problem as early as possible.
$headers = "From: test@test.org\r\n";
$headers .= "Return-Path: test@test.org\r\n";
$headers .= "Return-Receipt-To: test@test.org\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=iso-8859-1\r\n";
$headers .= "Message-ID: <".time()."-test@test.org>\r\n";
$headers .= "X-Mailer: PHP v".phpversion()."\r\n";
$bounceString = '-f test@test.org';
ini_set("SMTP","localhost");
ini_set("smtp_port","25");
ini_set("sendmail_from","me@localhost.org");
@mail ("$email","$subject","$message","$headers");
Thanks
I have been stuck with an issue related to mail in php. Following is the code that I have used. In the message part I want to use line breaks. For that first I have tried with <br />. Then it was ok with gmail, yahoo such mails. But not with my company id. It is looking as such as the html part in message.
Then I have tried with \n. Then the reverse happened. Working well with my company id but not with gmail and yahoo etc. Expecting a solution for this problem as early as possible.
$headers = "From: test@test.org\r\n";
$headers .= "Return-Path: test@test.org\r\n";
$headers .= "Return-Receipt-To: test@test.org\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=iso-8859-1\r\n";
$headers .= "Message-ID: <".time()."-test@test.org>\r\n";
$headers .= "X-Mailer: PHP v".phpversion()."\r\n";
$bounceString = '-f test@test.org';
ini_set("SMTP","localhost");
ini_set("smtp_port","25");
ini_set("sendmail_from","me@localhost.org");
@mail ("$email","$subject","$message","$headers");
Thanks