问题描述
我正在使用wamp服务器,并尝试发送电子邮件与PHP函数邮件('[email protected]','我的主题','我的身体');
,
在 php.ini
中的以下设置:
I'm using wamp server and trying to send email with the PHP function mail('[email protected]','my subject','my body');
,
with the following settings in php.ini
:
SMTP = 'ISP's SMTP server'
smtp_port = 25
但是我收到消息:
Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Relaying not allowed. Please use SMTP Authentication.
如何解决?
推荐答案
您的ISP的邮件服务器不允许中转,这是一件好事,否则最终会移动大量垃圾邮件。
Your ISP's mail servers do not allow "relaying", which is a good thing as otherwise they would end up moving a lot of spam.
为了能够利用您的ISP的邮件服务器,您需要进行身份验证首先使用用户名和密码。
To be able to utilize your ISP's mail servers you need to authenticate first with a username and password.
您可以尝试一下这个php.ini行的一个黑客:
You can try a hack of that php.ini line that goes like this:
SMTP ='username:password @ ISP的SMTP服务器地址'
这不能保证工作此选项需要在邮件服务器上设置非标准修改或选项。
This is not guaranteed to work as this option requires a non-standard modification or option to be set on the mail server.
您的另一个选项是简单地运行自己的本地代理邮件服务器,无需身份验证,然后将邮件直接发送到收件人的邮件服务器,或通过经过身份验证的连接到您的邮件服务器。
Your other option is to simply run your own local proxy mail server that requires no authentication, which will then either send the mail directly to the recipient's mail server, or via an authenticated connection to your mail server.
我不知道推荐什么与WampServer一起使用,但推荐的本地邮件服务器e:
I don't know what is recommended to be used with WampServer, but with WampDeveloper Pro the recommended local mail servers are:
- hmailserver
- mailenable
- Smartermail
您应该看到每个功能和要求。我相信其中一个可以干扰MySQL(安装程序会尝试放置自己的副本)。
You should see the features and requirements of each one. I believe one of them can interfere with MySQL (as the installer will try to place its own copy of it).
这篇关于使用PHP功能发送邮件时中继不允许的消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!