Wednesday, 21 August 2013

PHP mail() issue if it containg URL

PHP mail() issue if it containg URL

I am trying to send simple html email using PHP mail().
The following code work fine
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
If(mail('xyz@gmail.com', 'test mail', 'test<hr>this is a test mail',
$headers)){
Echo 'OK';
} else{
Echo 'Not ok';
}
Problem: as soon as I put some url in the body the code still say its ok
but email never received
If(mail('xyz@gmail.com', 'test mail', 'test<hr>this is a test mail from
www.xyz.com', $headers)){
Echo 'OK';
} else{
Echo 'Not ok';
}
Can someone guide me whats the issue and how to fix it?

No comments:

Post a Comment