【问题标题】:SMTPDataError at /accounts/signup/ (553, b'Relaying disallowed as webmaster@localhost')/accounts/signup/ 处的 SMTPDataError(553,b'Relaying disallowed as webmaster@localhost')
【发布时间】:2016-01-28 19:36:49
【问题描述】:

我使用的是 Django 1.7,我使用的是 Django allauth 进行身份验证。为了发送电子邮件,我开始使用 zoho smtp 服务器。它能够发送普通邮件和交易邮件,但不能发送注册对话邮件。它显示错误:

SMTPDataError at /accounts/signup/
(553, b'Relaying disallowed as webmaster@localhost')

回溯是:

69.             return self.dispatch(request, *args, **kwargs)
File "C:\Python34\lib\site-packages\django\utils\decorators.py" in _wrapper
  29.             return bound_func(*args, **kwargs)
File "C:\Python34\lib\site-packages\django\views\decorators\debug.py" in sensitive_post_parameters_wrapper
  76.             return view(request, *args, **kwargs)
File "C:\Python34\lib\site-packages\django\utils\decorators.py" in bound_func
  25.                 return func.__get__(self, type(self))(*args2, **kwargs2)
File "C:\Users\sp\industryo\allauth\account\views.py" in dispatch
  167.         return super(SignupView, self).dispatch(request, *args, **kwargs)
File "C:\Users\sp\industryo\allauth\account\views.py" in dispatch
  62.                                             **kwargs)
File "C:\Users\sp\industryo\allauth\account\views.py" in dispatch
  145.                                                           **kwargs)
File "C:\Python34\lib\site-packages\django\views\generic\base.py" in dispatch
  87.         return handler(request, *args, **kwargs)
File "C:\Users\sp\industryo\allauth\account\views.py" in post
  78.             response = self.form_valid(form)
File "C:\Users\sp\industryo\allauth\account\views.py" in form_valid
  183.                                self.get_success_url())
File "C:\Users\sp\industryo\allauth\account\utils.py" in complete_signup
  162.                          signal_kwargs=signal_kwargs)
File "C:\Users\sp\industryo\allauth\account\utils.py" in perform_login
  123.             send_email_confirmation(request, user, signup=signup)
File "C:\Users\sp\industryo\allauth\account\utils.py" in send_email_confirmation
  291.                                                     signup=signup)
File "C:\Users\sp\industryo\allauth\account\models.py" in send_confirmation
  60.         confirmation.send(request, signup=signup)
File "C:\Users\sp\industryo\allauth\account\models.py" in send
  137.                                 ctx)
File "C:\Users\sp\industryo\allauth\account\adapter.py" in send_mail
  100.         msg.send()
File "C:\Python34\lib\site-packages\django\core\mail\message.py" in send
  286.         return self.get_connection(fail_silently).send_messages([self])
File "C:\Python34\lib\site-packages\django\core\mail\backends\smtp.py" in send_messages
  99.                 sent = self._send(message)
File "C:\Python34\lib\site-packages\django\core\mail\backends\smtp.py" in _send
  115.             self.connection.sendmail(from_email, recipients, message.as_bytes(linesep='\r\n'))
File "C:\Python34\lib\smtplib.py" in sendmail
  800.             raise SMTPDataError(code, resp)

Exception Type: SMTPDataError at /accounts/signup/
Exception Value: (553, b'Relaying disallowed as webmaster@localhost')

这里有什么问题?我该如何解决这个问题?

【问题讨论】:

    标签: django smtp django-allauth zoho


    【解决方案1】:

    在您的设置中更改DEFAULT_FROM_EMAIL。错误消息是因为您的电子邮件提供商不接受默认值 webmaster@localhost

    【讨论】:

    • 效果很好。但我有一个问题。早些时候我使用的是 gmail smtp 服务器,它工作正常。这个问题只有在我开始使用 zoho 时才出现。可能的原因是什么?
    • 由运行 SMTP 服务器的人来决定他们接受哪些电子邮件。仅仅因为 Zoho 拒绝来自webmaster@localhost 的电子邮件并不意味着所有 SMTP 服务器都会拒绝。
    • Zoho 也把我带到了这里,虽然我仍然对它在本地工作感到惊讶。也许它不是 webmaster@localhost
    • 我参加聚会有点晚了。但我面临同样的问题。我正在使用 Zoho SMTP 发送“帐户激活电子邮件和密码重置电子邮件,并添加了 default_from_email 作为我的电子邮件 ID。现在我在我的网站上创建了一个联系表单,在这种情况下,我将用户的电子邮件 ID 添加为 from “电子邮件”在那种情况下,我在提交表单 SMTPDataError (553, b'Relaying disallowed as abc@xyz.com') 时收到以下错误
    猜你喜欢
    • 1970-01-01
    • 2021-02-13
    • 1970-01-01
    • 2021-10-19
    • 1970-01-01
    • 1970-01-01
    • 2022-08-22
    • 2013-11-25
    • 2021-03-05
    相关资源
    最近更新 更多