I saw many questions and answers on Stack Overflow and tried many of them to send a mail from localhost in XAMPP, but all the attempts were futile. Here is my semdmail.ini file:
smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
auth_username=******@gmail.com
auth_password=***
force_sender= *****@gmail.com
My php.ini file contains this
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
mail.add_x_header = Off
My php file is as follows
<?php
if(mail ('abcd@gmail.com', 'asdf', 'asdf', 'From: vh@gmail.com'))
{
echo 'success';
}else
{
echo 'sorry';
}
?>
Though I saw on net, I was unable to find a working solution.