mailgun / mailgun.js

Javascript SDK for Mailgun
https://www.npmjs.com/package/mailgun.js
Apache License 2.0
519 stars 110 forks source link

Cannot set 'Message-ID' for outgoing mail #394

Closed GeoffreyPlitt closed 9 months ago

GeoffreyPlitt commented 9 months ago

I am trying to set the "Message-ID" header for an outgoing message.

I'm doing this: messages.create(domain, { from: "...", to: ["..."], subject, 'h:Message-ID': messageId, text: body }) But when I examine the message that was sent, the Message-ID header is not set to my choice.

olexandr-mazepa commented 9 months ago

Hi @GeoffreyPlitt It seems unrelated neither to the SDK itself nor Mailgun API. As soon as you add the 'h:Message-ID' header you can find it under Mailgun Dashboard -> Sending -> logs -> message you've sent. Screenshot 2024-01-08 at 12 28 57

There is a StackOverflow thread that may be useful if you use the Message-ID header. https://stackoverflow.com/questions/40804429/gmail-is-modifying-headermessage-id-of-incoming-mails

GeoffreyPlitt commented 9 months ago

You're right!

For anyone curious, the problem was my messageID was not in the correct format (must be uniqueid@domain)