我對 PHP 中的 mail() 函數有疑問。我正在使用 XAMPP。這是我的配置文件:php.ini[mail function]SMTP = smtp.gmail.comsmtp_port = 587sendmail_from = [email protected]_path = C:\xampp\sendmail\sendmail.exe\sendmail.ini (C:\xampp\sendmail\sendmail.ini)[sendmail]smtp_server = smtp.gmail.comsmtp_port = 587error_logfile = error.logdebug_logfile = debug.logauth_username = [email protected]_password = my_passwordforce_sender = [email protected]這是我的代碼:<?php$to= "[email protected]";$subject = "Title";$messages= "Lorem ipsum dolor sit amet.";if( mail($to, $subject, $messages) ) { echo "Email sent!";} else { echo "Not sent!";}?>該程序正在返回電子郵件已發送!消息,但郵件沒有投遞到我的郵箱。我已經嘗試將php.ini和sendmail.ini中的端口更改為 465,但沒有任何改變。你有什么主意嗎?
- 1 回答
- 0 關注
- 128 瀏覽
添加回答
舉報
0/150
提交
取消