gpt4 book ai didi

php - 使用 PHP 函数发送邮件时中继不允许的消息

转载 作者:行者123 更新时间:2023-12-01 22:44:00 25 4
gpt4 key购买 nike

我正在使用 wamp 服务器并尝试使用 PHP 函数发送电子邮件 mail('me@ISPdomain.com','my subject','my body'); ,
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 的邮件服务器不允许“中继”,这是一件好事,否则它们最终会移动大量垃圾邮件。

http://en.wikipedia.org/wiki/Open_mail_relay

An open mail relay is an SMTP server configured in such a way that it allows anyone on the Internet to send e-mail through it, not just mail destined to or originating from known users. This used to be the default configuration in many mail servers; indeed, it was the way the Internet was initially set up, but open mail relays have become unpopular due to their exploitation by spammers and worms. Many relays were closed, or were placed on blacklists by other servers.

为了能够使用您的 ISP 的邮件服务器,您需要先使用用户名和密码进行身份验证。

您可以尝试修改 php.ini 行,如下所示:

SMTP = '用户名:密码@ISP的SMTP服务器地址'

这不能保证有效,因为此选项需要在邮件服务器上设置非标准修改或选项。

您的另一种选择是简单地运行您自己的不需要身份验证的本地代理邮件服务器,然后将邮件直接发送到收件人的邮件服务器,或者通过经过身份验证的连接到您的邮件服务器。

我不知道建议与 WampServer 一起使用什么,但与 WampDeveloper Pro 一起使用推荐的本地邮件服务器是:

  1. hmail服务器
  2. 可邮寄
  3. 智能邮箱

您应该看到每一个的功能和要求。我相信其中之一会干扰 MySQL(因为安装程序会尝试放置它自己的副本)。

关于php - 使用 PHP 函数发送邮件时中继不允许的消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6096449/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com