无法连接到"localhost"上的邮件服务器端口25,请验证您的"SMTP"和"smtp_port"在php.ini中设置或使用ini_set() [英] Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()

查看:613
本文介绍了无法连接到"localhost"上的邮件服务器端口25,请验证您的"SMTP"和"smtp_port"在php.ini中设置或使用ini_set()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
无法连接到"localhost"的邮件服务器端口25

Possible Duplicate:
Failed to connect to mailserver at “localhost” port 25

但是我用了这个

$to = "somebody@example.com";
$subject = "My subject";
$txt = "Hello world!";
$headers = "From: webmaster@example.com" . "\r\n" .
"CC: somebodyelse@example.com";

mail($to,$subject,$txt,$headers);

我遇到此错误,该错误无法通过"localhost"端口25连接到邮件服务器,无法验证php.ini中的"SMTP"和"smtp_port"设置或使用ini_set()

I have this error which is Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()

推荐答案

如果您仅在localhost上运行应用程序,而该应用程序尚未启用,我相信使用此应用程序发送邮件非常困难.

If you are running your application just on localhost and it is not yet live, I believe it is very difficult to send mail using this.

将您的应用程序置于在线状态后,我相信应该自动解决此问题. 顺便说一句,ini_set()可帮助您在运行时更改php.ini中的值.

Once you put your application online, I believe that this problem should be automatically solved. By the way,ini_set() helps you to change the values in php.ini during run time.

这与无法连接到邮件服务器在本地主机"端口25

还要检查此 php邮件功能不起作用

这篇关于无法连接到"localhost"上的邮件服务器端口25,请验证您的"SMTP"和"smtp_port"在php.ini中设置或使用ini_set()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆