亚马逊错误:554,b'邮件被拒绝:电子邮件地址未验证?

2024-06-08 13:43:06 发布

您现在位置:Python中文网/ 问答频道 /正文

我想使用亚马逊的简单电子邮件服务发送电子邮件

我验证了我的域名以及我想发送的电子邮件地址。我没有处于沙箱模式

我可以在注册时收到电子邮件,但当我尝试重置密码时,会收到SMTPDataError异常

(554, b'Message rejected: Email address is not verified. The following identities failed the check in region AP-SOUTH-1: webmaster@localhost')

如何解决这个问题


Tags: 密码messageisaddress电子邮件email地址模式
2条回答

由于以下原因发生554错误:

'554 message rejected for policy reasons' – What this means? In a mail delivery, the recipient server performs a series of checks to verify the authenticity of the sender and the message. If the recipient server has doubt in the sender's authenticity or the sender's message, it rejects such emails

正如评论中提到的user@GAEfan,您正试图从localhost运行此操作,如异常webmaster@localhost中所示,无需验证电子邮件。遵循指南here确保所有内容都经过验证

在生产环境中运行此操作不会产生此错误。如果您已经按照指南here在沙箱中验证了它,那么这就足够了

如错误消息所示,Django正在使用webmaster@localhost用于通过亚马逊SES发送电子邮件。然而webmaster@localhost是一封未经验证且无法验证的电子邮件。预期发件人电子邮件地址必须不同,但默认情况下Django使用webmaster@localhost.

若要解决此问题,请在项目的settings.py文件中添加属性

默认\u来自\u电子邮件=yourmail@yourdomain.com>;'

这样Django就可以使用您预定的发件人电子邮件地址

相关问题 更多 >