我正尝试使用Django和EmailMultiAlternatives发送邮件。它可以很好地工作,但是在“from”中显示为“info”。
是否可能使用我的姓名?我该如何做到这一点?
以下是我的代码:
subject, from_email, to = 'Afiliations', 'info@domain.com', 'other@domain.com'
text_content = 'Afiliation is working.'
t = loader.get_template('emails/afiliados.html')
c = Context({ 'order': order_obj })
html_content = t.render(c)
msg = EmailMultiAlternatives(subject, text_content, from_email, [to])
msg.attach_alternative(html_content, "text/html")
msg.send()
"<info@domain.com> info@domain.com"
- karthikr