PHP邮件生成错误 [英] PHP mail is generating the an error

查看:79
本文介绍了PHP邮件生成错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在php中使用邮件,并且收到以下错误.谁能帮我解决错误:
错误消息:
警告:mail()[function.mail]:无法通过"localhost"端口25连接到邮件服务器,无法验证php.ini中的"SMTP"和"smtp_port"设置,或在inD:\ xampp中使用ini_set()第98行上的htdocs \ rajesh \ registrationProcess.php

I am using the mail in php and I get the following error. Can any one please help me in resolving the error:
error message :
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() inD:\xampp\htdocs\rajesh\registrationProcess.php on line 98

推荐答案

您的邮件服务器的网址似乎不正确. Localhost是您的系统,就像您的电子邮件服务器可能会位于其他地方一样.
The url to your mailserver appears to be incorrect. Localhost is your system, where as your email server would probably be located somewhere else.


如果您想从本地主机发送邮件,则XAMPP附带了一个名为Mercury的邮件服务器. br/>
在您的XAMPP文件夹中,找到Mercury文件夹,打开该文件夹,然后打开Mercury.exe.

然后按照此 http://www.danieltmurphy.com/setting-up-mercury-smtp/ [ ^ ]

打开Xampp控制面板,选中"Mercury SVC"复选框,然后单击开始".

要点:尽管您可以从本地服务器发送邮件.这是不希望的.因为

1)许多其他收件人邮件服务器会阻止未知主机发出的邮件,以防止垃圾邮件
2)将其移至生产服务器时,必须重新配置所有内容.

因此,更好的建议是使用预期的托管域可用的邮件服务器.
If you want to sent mail from local host then XAMPP comes with a mail server called Mercury.

In your XAMPP folder find the folder Mercury open that and open the Mercury.exe.

Then follow this http://www.danieltmurphy.com/setting-up-mercury-smtp/[^]

Open Xampp control panel, check the Mercury SVC checkbox and click start.

Important Point: Though you can send mails from local server. It is not desired. Because

1) Many other receiver mail servers block mails arising from unknown host as a precaution of spamming
2) When you move this to a production server you have to reconfigure everything.

So better advice is use the Mail server available with your expected hosting domain.


这篇关于PHP邮件生成错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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