i want to send email using php through xampp server.here is my code
<?php
$to = 'atchibabu@solbaacken.com';
$subject = 'My Email';
$msg = "please find details";
// Make sure to escape quotes
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: My Site Name <atchibabu516@gmail.com.com>' . "\r\n";
if(mail($to, $subject, $msg, $headers))
{
echo "success";
}
else
{
echo "fail";
}
?>
when i execute i get “success” message but i didn’t get any mail i am waiting still one hour
i don’t know why it’s happening. some suggestions send email using smtp so can any one guide how could i use the smtp.i am using mac xampp so any one guide me i could i install smtp in mac xammp.
thanks for advance.
Few things to note:
Your from has 2
.comso, probability of your message going in SPAM is almost 90%.Check your phpinfo(); output. What does sendmail_path show? Do you have that software installed? Ideally it is
/usr/sbin/sendmail -t -iand the software issendmailin ubuntu machines.Also, in your phpinfo(), check the SMTP port. Also there is a high possibility of getting blocked by a firewall or similar software, checked it already?