警告:mail()[function.mail]:无法通过我的邮件ID连接到邮件服务器验证您的“SMTP”。和“smtp_port”在php.ini中设置或使用ini_set() [英] Warning: mail() [function.mail]: Failed to connect to mailserver at my mail id verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()

查看:203
本文介绍了警告:mail()[function.mail]:无法通过我的邮件ID连接到邮件服务器验证您的“SMTP”。和“smtp_port”在php.ini中设置或使用ini_set()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我有以下编码发送邮件



Hi I have the following coding to send mail

ini_set("SMTP","xxxx@example.com");
ini_set("smtp_port","25");
ini_set("sendmail_from", 'xxxx@example.com');
$to = "xxxx@example.com";
$subject = "test from localhost";
$msg = "I completely understand SMTP servers now!";
$headers = "From: localhost@localhost.com\nReply-To: localhost@localhost.com";
$config = "-stfu@noob.com";
mail("$to", "$subject", "$msg", "$headers", "$config");
echo "finished!";





但我收到警告警告:mail()[function.mail]:无法连接到xxxx的邮件服务器@ example.com端口25,在php.ini中验证你的SMTP和smtp_port设置或使用ini_set()。

如何解决这个问题?



But i am getting the warning as Warning: mail() [function.mail]: Failed to connect to mailserver at xxxx@example.com port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set().
How to solve this?

推荐答案

to = xxxx@example.com;
to = "xxxx@example.com";


subject = 从localhost测试;
subject = "test from localhost";


msg = 我现在完全理解SMTP服务器!;
msg = "I completely understand SMTP servers now!";


这篇关于警告:mail()[function.mail]:无法通过我的邮件ID连接到邮件服务器验证您的“SMTP”。和“smtp_port”在php.ini中设置或使用ini_set()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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