“服务器不支持SMTP AUTH扩展名。”在实时服务器上,在本地主机上工作正常

时间:2019-10-29 05:10:12

标签: django email

这是我正在使用的代码(在声明模型之后):

def order_update(sender, instance, created, **kwargs):
    subject = 'subject'
    from_email = 'sender@mail.com'
    to = 'receiver@mail.com'
    text_content = f'text'
    html_content = f'html'
    msg = EmailMultiAlternatives(subject, text_content, from_email, [to])
    msg.attach_alternative(html_content, "text/html")
    msg.send(fail_silently=False)


post_save.connect(order_update, sender=Order)

在localhost上运行良好,每当创建对象时都会发送一封电子邮件。 但是,当我将其上传到实时环境Ubuntu 16.04时,它会出现以下错误:SMTP AUTH extension not supported by server.

0 个答案:

没有答案