Sender name not display when sending emails via Mailgun

Viewed 757

I am using Mailgun to send mail to my users from Python. Everything works fine except 1 problem. When the user receives the email, it does not show the intended sender name, instead it shows the email which I use to send the email.

Here is the example. In this example, I send an email to my users using the email support@mydomain.com. This is what they see in their inbox if I send using Mailgun from Python

enter image description here

However, if I send email manually from support@mydomain.com to my users using Gmail, not Mailgun, the word support in the picture will be replaced with the correct name I set up, which is Kevin from Mydomain.com. My question is how do I configure Mailgun so that emails sent from Mailgun also show the correct sender name, not the first part of the email I use to send emails (in this case the first part of support@mydomain.com is support).

1 Answers

The simplest is to include the sender name in the API request

curl -s --user 'api:YOUR_API_KEY' \
  https://api.mailgun.net/v3/YOUR_DOMAIN_NAME/messages \
  -F from='Sender Bob <sbob@YOUR_DOMAIN_NAME>' \
  ...

(or do the respective with your library)

Related