Overview
Mailgun supports using a Reply-To address through the h:Reply-To parameter (API) and Reply-To: header (SMTP).
However, the Reply-To address must be added to the message by your sending application before submitting the message to Mailgun for processing and delivery.
Understanding the context
You're following all the email best practices including sending from a subdomain with MX records pointing to Mailgun (right?!). Even the From address uses the subdomain to ensure you're DMARC-aligned and ready to pass Sender Address Verification. Perhaps you even have Mailgun Routes set up to process any incoming email arriving to your subdomain.
Nonetheless, you have reasons for needing any replies to return to your personal address (like a @outlook.com address) rather than the address listed in the From field. If only you had... a Reply-To address!
Mailgun allows you to add Reply-To addresses to your emails, but it's important to note the Reply-To address must be set within the message before your application sends the email to Mailgun for processing and delivery.
Implementing the solution
Determining your sending method
It's important to confirm whether your application sends email by API or SMTP. Your IT technician, team, or department can confirm the sending method and assist with any needed configuration changes to enable the use of the Reply-To address.
Sending with the API
- If you're using the API natively, you'll need to add the following parameter:
h:Reply-To = 'user@domain.tld"
- If you're using the API through a framework or plugin, it is possible the h:Reply-To parameter is not supported. As such, we recommend contacting the support team of said application to confirm whether adding the parameter is possible.
Below is an API request that utilizes the h:Reply-To parameter:
curl -s --user 'api:YOUR_API_KEY' \
https://api.mailgun.net/v3/YOUR_DOMAIN_NAME/messages \
-F from='Mailgun User <from.addy@YOUR_DOMAIN_NAME>' \
-F to='to.addy@domain.tld' \
-F h:Reply-To='reply.addy@personal-domain.tld' \
-F subject='Howdy!' \
-F text='Testing the awesomeness that is Mailgun!'
Sending with SMTP
- If you're using SMTP with a technically-robust (i.e. high technical complexity) email application, adding the Reply-To header will be possible. The header will appear like so:
Reply-To: user@domain.tld
- If you're using SMTP with a user-friendly (i.e. low technical complexity) email application, it is possible the Reply-To: header is not supported. As such, we recommend contacting the support team of said application to confirm whether adding the header is possible.
Below is a set of email headers that utilizes the Reply-To: header:
Need Support?
Our Support Team here at Sinch Mailgun is happy to help! Reach out to us in the Support page of your Mailgun Control Panel, and we'll be with you shortly!