我正在尝试使用Django和EmailMultiAlternatives发送邮件.它运作良好,但在"来自"说"信息"
举个例子说我的名字是否可行?我怎样才能做到这一点?
这是我的代码:
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()
Run Code Online (Sandbox Code Playgroud)