3

I want a name to appear instead of an email address when the user receives an email that is sent from django send_mail().

For example:

When an email is sent with the below code the person who receives it sees to@ex.com in his inbox. I would like a name to be displayed.

send_mail('subject', 'content', from@ex.com, ['to@ex.com'], fail_silently=False)

Just like when companies send their emails to users, we dont see an email address instead we see the company name.

H H H
  • 489
  • 1
  • 7
  • 20

1 Answers1

19

Try using a display name:

send_mail('subject', 'content', 'Name <from@ex.com>', ['to@ex.com'], fail_silently=False)
Community
  • 1
  • 1
Gonzalo
  • 4,145
  • 2
  • 29
  • 27