【发布时间】:2013-09-19 12:07:50
【问题描述】:
我的脚本正常工作,因为它显示“消息已发送!”但没有收到指定电子邮件的电子邮件。顺便说一句,使用 XAMPP。感谢帮助。谢谢。
<?php
$to = 'theaccount@yahoo.com';
$subject = 'Sample Subject';
$message = 'Hi. This is a sample message.';
$headers = 'From: webmaster@august.ai.com' . "\r\n" .
'Reply-To: no-reply@august.ai.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
echo (mail($to, $subject, $message, $headers)) ? 'Message sent!' : 'Message not sent!';
?>
这是来自我的 php.ini 和 sendmail.ini 的信息:
php.ini:
[mail function]
; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury
; SMTP = theaccount@yahoo.com
; smtp_port = 25
sendmail.ini:
smtp_server=smtp.mail.yahoo.com
; smtp port (normally 25)
smtp_port=25
auth_username=theaccount+yahoo.com
auth_password=passwordhere
【问题讨论】: