我已经在Windows 8上安装了wamp。
得到错误:
警告:mail()[function.mail]:无法通过“ localhost”端口25连接到邮件服务器,无法验证php.ini中的“ SMTP”和“ smtp_port”设置,或在C:\ wamp \ www \中使用ini_set()第9行的mail.php
这是简单的源代码:
<?php
// The message
$message = "Line 1\r\nLine 2\r\nLine 3";
// In case any of our lines are larger than 70 characters, we should use wordwrap()
$message = wordwrap($message, 70, "\r\n");
// Send
mail('[email protected]', 'My Subject', $message);
?>
我必须在Windows 8上安装哪些软件才能通过php通过电子邮件发送电子邮件?sendmail,msmtp或ssmtp?
试试这个
配置此设置
在php.ini中
SMTP=smtp.gmail.com
smtp_port=587
sendmail_from = [email protected]
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
在sendmail.ini中:
smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
[email protected]
auth_password=my-gmail-password
[email protected]
重要提示:评论,如果有另一个以下行
sendmail_path
中php.ini
:sendmail_path="C:\xampp\mailtodisk\mailtodisk.exe"
注意:经过测试,在我的Windows 8.1中运行正常
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句