Send_mail Django send as alias email
I'm solving problem, that of course I'm sending an email like sender email, which I authenticated in settings.py, but what if I want to send and email as request.user.email
alias?
send_mail("Hello", "hello", settings.EMAIL_HOST_USER, [settings.EMAIL_RECEIVER])
is this some reason how to do that?
Thanks a lot
settings.EMAIL_HOST_USER Is used for authentication.
It should be like this:
send_mail("Hello", "hello", “sender@email.com”, [“recipient@email.com”], fail_silently=False, auth_user=settings.EMAIL_HOST_USER, auth_password=None, connection=None, html_message=None)
To add an email alias you just need to add that field to your user model and reference that instead of “sender@email.com”