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 = [email protected] 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 [email protected] auth_password=(My passowd) [email protected]
And My PHP code is
$to = '[email protected]'; $subject = 'This is subject'; $message = 'This is HTML message'; $header ='From:[email protected]'; $send = mail($to,$subject,$message,$header); if($send == true) {echo "Mail Sent";} else { echo "Error";}