【问题标题】:Using XAMPP to send mail使用 XAMPP 发送邮件
【发布时间】: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

ma​​il.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"

【问题讨论】:

标签: php email xampp


【解决方案1】:

到 Windows8

修改文件后

1-php.ini

2-sendmail.ini

转到 C:\xampp\sendmail

1) 右键单击​​ sendmail.exe 并转到属性。

2) 单击兼容性选项卡,然后单击更改所有用户的设置。

3) 将兼容模式设置为 Windows XP (Service Pack 3)

4) 单击以管理员身份运行此程序的复选框

希望对其他人有所帮助。

它对我有用

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-03-13
    • 2015-12-16
    • 2012-12-15
    • 2013-04-06
    • 2015-10-26
    • 2012-05-07
    • 2015-01-05
    相关资源
    最近更新 更多