Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the email subject duplicated in MailGun's HTTP post?

I am using a MailGun action to forward an inbound email to a REST service on our server. When MailGun posts the email to our server, the subject of the email is duplicated.

I using ASP .NET's HttpRequest object to read the value of the subject from the POST like so:

string subject = request["Subject"]; //If email subject was "Test" the contents of subject would be "Test,Test"

Why is this happening?

like image 251
Brian Avatar asked Nov 05 '25 17:11

Brian


1 Answers

The reason is that MailGun is passing the subject in twice, once as "subject" and again as "Subject". This was done for backward compatibility. Apparently .NET is merging them into the one field.

like image 169
Brian Avatar answered Nov 08 '25 08:11

Brian