I am trying to send mail from localhost to my gmail. I am using windows 7. My mail() function is showing not any error on submit. Instead, on submit, a window appears and disappears suddenly even i can't see the window properly.
mail.php
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
if(mail($to, $subject, $body,$headers))
{
echo 'Mail has send';
}
else
{
echo "Email Not Found";
}
php.ini
1130 [mail function]
1131 ; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury
1132 SMTP = smtp.gmail.com
1133 smtp_port = 587
1134 sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
sendmail.ini
[sendmail]
smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
auth_username=mygmail.com
auth_password=myPass
force_sender=mygmailgmail.com