バックグラウンド :-
私のメールバックエンドは次のようなものです:
EMAIL_HOST ='smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = 'feedback@example.com'
EMAIL_HOST_PASSWORD = 'XXX'
EMAIL_USE_TLS = True
問題:-
EmailMultiAlternatives を使用して HTML メールを送信しています。「から」を変更できるように、auth_userとauth_passwordを定義したいと思います。基本的に私は EMAIL_HOST_USER をオーバーライドしたいのですが、from_email は冗長、つまり「サポート チーム」にしたいと考えています。どうすればそれができますか?
subject, from_email, to = "hello", 'Support Team','to_user@gmail.com'
text = "hello"
html = "<strong>hello</strong>"
msg = EmailMultiAlternatives(subject, text_content, from_email, [to])
msg.attach_alternative(html_content, "text/html")
msg.send(fail_silently=False,auth_user = 'support@example.me',auth_password = 'XXX')