У меня одна проблема с отправкой писем из офиса 365 (Godaddy) с помощью django send_mail в Ubuntu 16.04 DigitalOcean.
Это моя фактическая конфигурация:
EMAIL_HOST = 'smtp.office365.com'
EMAIL_HOST_USER = "myuser"
EMAIL_HOST_PASSWORD = 'mypassword'
EMAIL_USE_TLS = True
EMAIL_PORT = 587
Отправка почты:
context = {}
subject = 'Verificación de registro con 1 clic'
txt_ = get_template("registration/emails/verify.txt").render(context)
from_email = settings.DEFAULT_FROM_EMAIL
recipient_list = [somemail@somemail.com]
html_ = get_template("registration/emails/verify.html").render(context)
sent_mail = send_mail(
subject,
txt_,
from_email,
recipient_list,
html_message=html_,
fail_silently=False,
)
Это ошибка:
raise SMTPSenderRefused(code, resp, from_addr)
smtplib.SMTPSenderRefused: (530, b'5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM []', '=?utf-8?q?myuser?= <myemail@myemail.com>')