I have been trying so many times to send mail from xampp, for that I set all things which is required but still mail function is not working.
I have tried with the following steps:
Remove
;
fromphp.ini
file whereextension=php_openssl.dll
[mail function]
SMTP=smtp.gmail.com smtp_port=587 sendmail_from = shail.gandhi132@gmail.com sendmail_path = "\"c:\xampp\sendmail\sendmail.exe\" -t"
C:\xampp\sendmail
[sendmail]
smtp_server=smtp.gmail.com smtp_port=587 error_logfile=error.log debug_logfile=debug.log auth_username=shail.gandhi132@gmail.com auth_password=(My passowd) force_sender=shail.gandhi132@gmail.com
And My PHP code is
$to = 'sgandhi132@gmail.com'; $subject = 'This is subject'; $message = 'This is HTML message'; $header ='From:shail.gandhi132@gmail.com'; $send = mail($to,$subject,$message,$header); if($send == true) {echo "Mail Sent";} else { echo "Error";}