I want to send a mail from my php script using mail
function.so i installed Wamp
and did setting in sendmail.ini
and php.ini
using this link
When i run my php program its giving:
Email sending failed
my php program is as follows:
<?php
$to = 'xyz@gmail.com'; /* here i added email id of person which i want to send mail */
$subject = 'Testing sendmail.exe';
$message = 'Hi, you just received an email using sendmail!';
$headers = 'From: myid@gmail.com' . "\r\n" .
'Reply-To: myid@gmail.com' . "\r\n" .
'MIME-Version: 1.0' . "\r\n" .
'Content-type: text/html; charset=iso-8859-1' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
if(mail($to, $subject, $message, $headers))
echo "Email sent";
else
echo "Email sending failed";
?>
So i am not getting where i am wrong. Can any one help me on this.
Thank you.