How to send Django AllAuth email verification as alias
I just setup a Google workspace. One of the accounts has an alias: info@domain.com. I’d like to send all emails from that alias. I know I have to authenticate with the actual account email address through EMAIL_HOST_USER (which I have done), but how do I force Django AllAuth to send emails from the alias email? Is this something that can be achieved by overriding AllAuth views and using send_mail()? Any help would be appreciated.
You can use send_email()
for that all you need to do is pass from_email
argruament in send_email()
function.
like this:
send_mail(
'Subject here',
'Here is the message.',
'from@example.com',
['to@example.com'],
fail_silently=False,
)
You can go through the documentation here: https://docs.djangoproject.com/en/4.1/topics/email/#send-mail