wordpress   发布时间:2022-04-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了在Windows 8上无法发送带有php邮件功能的邮件大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

我已经在 windows 8上安装了wamp. 有错误: Warning: mail() [function.mail]: Failed to connect to mailserver at “localhost” port 25, verify your “SMTP” and “smtp_port” setTing in php.ini or use ini_set() in C:\wamp\
我已经在 windows 8上安装了wamp.

错误

这里是简单的源代码

<?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('caffeinated@example.com','My Subject',$messagE);
?>

我必须通过PHP在Windows 8上安装哪些软件来发送电子邮件? sendmail,msmtp或ssmtp?

尝试这个

配置此设置

PHP.ini

SMTP=smtp.gmail.com
smtp_port=587
sendmail_from = my-gmail-id@gmail.com
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
auth_username=my-gmail-id@gmail.com
auth_password=my-gmail-password
force_sender=my-gmail-id@gmail.com

大佬总结

以上是大佬教程为你收集整理的在Windows 8上无法发送带有php邮件功能的邮件全部内容,希望文章能够帮你解决在Windows 8上无法发送带有php邮件功能的邮件所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。