Invalid email address error when sending email via Django

Viewed 1186

EDIT

I wonder why from_email = 'My custom from' no longer works?

from_email = 'mycustomfrom@example.com' which is not a valid email neither works


I try to send an email using send_mail but get the error

raise SMTPSenderRefused(code, resp, from_addr) smtplib.SMTPSenderRefused: (501, b'5.1.7 Invalid address', '=?utf-8?q?django?=')

I've tried in a shell, but get the same error

>>> from django.core.mail import send_mail
>>> subject = 'subject'
>>> message = 'message test'
>>> email_from = 'django'
>>> recipient_list = ['user@hotmail.fr']                       ***-> I am sure my email adress is valid***
>>> send_mail(subject, message, email_from, recipient_list)

the error seems to come from my email_from parameters because of an invalid email address that is true but:

  1. it used to works
  2. if I change to a valid email address I got another error:

smtplib.SMTPRecipientsRefused: {'user@hotmail.fr': (550, b'5.7.54 SMTP; Unable to relay recipient in non-accepted domain')}

1 Answers

email domain was not accepted in smtp server. Not it is resolved

Related