Set "reply-to" header field for mailgun

You can programmatically add the header "Reply-To" in the data you are sending.

For example, this snippet works well in Python:

import requests

url = 'https://api.mailgun.net/v3/YOUR_ACCOUNT/messages'
auth = ('api', 'YOUR_KEY')
data = {
    'from': 'Info <[email protected]>',
    'to': ['[email protected]', '[email protected]'],
    'subject': 'test email',
    'html': '<b>hello!</b> that's all.,
    'text': 'plain text here',
    'o:tag': ['categoria 1', 'categoria 2']
}
data['h:Reply-To']="My name <[email protected]>"  # <------------- HERE!
res = requests.post(url, auth=auth, data=data)

I am not sure if you are still looking for the answer, but you can set the Reply-To header using the API.

h:Reply-To

I have been using it with an email hash - each user gets a unique hash in the reply-to field so I know who is replying. Basically the reply-to looks like this:

"h:Reply-To" : "[email protected]"

In the routes panel add the following and you can redirect to your email or to an HTTP endpoint:

match_recipient("^inboundaddress\+(.*)@mydomain.com")

Hope that helps. Justin

Tags:

Email

Mailgun