以下分别是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";
}
我总是收到true
,$sent
但上述地址没有收到电子邮件。这可能是什么原因?配置文件有什么问题吗?
注意:
我上传php.ini
和sendmail.ini
@github ,我在 25 日运行水星