【发布时间】:2013-03-13 01:32:20
【问题描述】:
以下分别是php.ini和sendmail.ini中的配置:
[mail function]
sendmail_path = ""\"E:\Installed_Apps\xampp\sendmail\sendmail.exe\" -t""
mail.add_x_header = Off
[sendmail]
SMTP = localhost
smtp_port = 25
smtp_server=smtp.gmail.com
smtp_port=587
smtp_ssl=auto
error_logfile=error.log
auth_username=my_gmail_address
auth_password=my_xxxxxx
pop3_server=
pop3_username=
pop3_password=
force_recipient=
hostname=
我尝试发送电子邮件为:
<?php
$sent = mail('to_someone@hotmail.com','Message sent from XAMPP','Hey ! I just sent you a message using XAMPP');
if($sent) {
echo "Mail sent successfully";
}else {
echo "Sending failed";
}
对于$sent,我总是收到true,但上述地址没有收到电子邮件。这可能是什么原因?是不是配置文件有问题?
注意:
我上传了 php.ini 和 sendmail.ini @github,我在 25 日运行水银
【问题讨论】:
-
您是否阅读了文档页面上的注释和 cmets? php.net/mail
-
来自the manual "重要的是要注意,仅仅因为邮件被接受投递,并不意味着邮件实际上会到达预定目的地。"
-
检查smtp服务器是否作为windows服务运行