localhostから自分のGmailにメールを送信しようとしています。私は窓7を使用しています。私のmail()関数は送信時にエラーを表示していません。代わりに、提出すると、ウィンドウが正しく表示されなくても、ウィンドウが表示されて突然消えます。ローカルホストからメールが届かない
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