【发布时间】:2015-07-03 14:37:26
【问题描述】:
我一直在尝试使用 XAMPP 发送电子邮件,但它似乎不起作用。我已经看过有关如何做到这一点的教程,但最终它仍然失败。我使用的是 Windows 8。
这些是我更改的文件。
php.ini
<?php
$send = mail(
"childrenbirthdayparty@gmail.com",
"hello!",
"hello",
"From:childrenbirthdayparty@gmail.com"
);
if ($send) {
echo "yes";
} else {
echo "no";
}
?>
sendmail.ini
smtp_server = smtp.gmail.com
smtp_port = 465
smtp_ssl = SSL
error_logfile = error.log
debug_logfile = debug.log
auth_username = childrenbirthdayparty@gmail.com
auth_password = password(not real password)
force_sender = childrenbirthdayparty@gmail.com
hostname = smtp.gmail.com
mail.php
[mail function]
; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury
SMTP = smtp.gmail.com
smtp_port = 465
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
mail.add_x_header=Off
mail.log = "C:\xampp\php\logs\php_mail.log"
【问题讨论】: