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

2

10

I am using Django 1.7 and for authentication I am using Django allauth. For sending email, I started using zoho smtp server. It is able to send normal & transactional mails but it cannot send signup conversation email. It shows the error:

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

The traceback is :

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')

What is the issue here? How can I solve this problem?

Coastal answered 28/10, 2015 at 20:32 Comment(0)
F
17

Change DEFAULT_FROM_EMAIL in your settings. The error message is because your email provider does not accept the default value, webmaster@localhost.

Fullgrown answered 28/10, 2015 at 20:41 Comment(4)
That worked perfectly. But I have one question. Earlier i was using gmail smtp server and it was working fine. This problem showed up only when i started using zoho. what can be the possible reason?Coastal
It's up to whoever runs the SMTP server to decide which emails they accept. Just because Zoho rejects an email from webmaster@localhost doesn't mean all SMTP servers will.Fullgrown
Zoho brought me here also, Though i'm still surprised that it worked locally. Maybe it was something other than webmaster@localhostGujarati
I am somewhat late to the party. But I am facing the same issue. I am using Zoho SMTP to send "Account activation email and password reset email and have added the default_from_email as my email id. Now I have created a contact form on my website, in that case I am adding the email id of the user as from "email" at that instance I am getting the following error on submitting the form SMTPDataError (553, b'Relaying disallowed as [email protected]')Schell
N
0

Check If you have filled the from_email correctly in send_mail function or set DEFAULT_FROM_EMAIL to the mailing app email id.

from django.core.mail import send_mail
send_mail(
    subject="",
    recipient_list="",
    from_email="",  # Fill this correctly
    message=""
    html_message=""
)
Natalya answered 7/2 at 11:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.