Search code examples
djangodjango-allauth

How to change the Display Name on sent emails with django allauth?


I'm using django allauth to sign up users and sending confirmation emails to new users and it's working fine except that it shows "support" as in "[email protected]" as my name. I'd like it to change that to "Khaled from XYZ".

I tried the following but it actually crashed the smtp connection:

EMAIL_HOST_USER = 'Khaled from XYZ <[email protected]>'
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER

Solution

  • EMAIL_HOST_USER needs to be the username your SMTP server expects for authentication.

    DEFAULT_FROM_EMAIL is what gets put in the email header, and can be more verbose:

    EMAIL_HOST_USER = '[email protected]'
    DEFAULT_FROM_EMAIL = 'Khaled from XYZ <[email protected]>'