Sending Email Via MailGun SMTP Print

  • 0

To be able to send email via MailGun SMTP you read this knowledgebase article: Where do I find my MailGun information?

Mailgun supports sending via SMTP. The servers listen on port25465587, and 2525Port 465 requires a TLS connection. Port25587, and 2525 require a non-TLS connection but may be upgraded to TLS using the STARTTLS command.

Use “plain text” SMTP authentication and the credentials from the domain details page in your Control Panel which can be found by clicking on a domain in the Domains Tab. For enhanced security, use TLS encryption.

Passing Sending Options

When sending a message via SMTP you can pass additional sending options via custom MIME headers listed in the table below.

Header Description
X-Mailgun-Tag Tag string used for aggregating stats. See Tagging for more information. You can mark a message with several categories by setting multiple X-Mailgun-Tag headers.
X-Mailgun-Dkim Enables/disables DKIM signatures on per-message basis. Use yes or no.
X-Mailgun-Deliver-By Desired time of delivery. See Scheduling Delivery and Date Format.
X-Mailgun-Drop-Message Enables sending in test mode. Pass yes if needed. See Sending in Test Mode.
X-Mailgun-Track Toggles tracking on a per-message basis, see Tracking Messages for details. Pass yes or no.
X-Mailgun-Track-Clicks Toggles clicks tracking on a per-message basis. Has higher priority than domain-level setting. Pass yesno or htmlonly.
X-Mailgun-Track-Opens Toggles opens tracking on a per-message basis. Has higher priority than domain-level setting. Pass yes or no.
X-Mailgun-Require-TLS Use this header to control TLS connection settings. See TLS Sending Connection Settings
X-Mailgun-Skip-Verification Use this header to control TLS connection settings. See TLS Sending Connection Settings
X-Mailgun-Recipient-Variables Use this header to substitute recipient variables referenced in a batched mail message. See Batch Sending
X-Mailgun-Variables Use this header to attach a custom JSON data to the message. See Attaching Data to Messages for more information.
X-Mailgun-Delivery-Time-Optimize-Period Toggles STO on a per-message basis. String should be set to the number of hours in [0- 9]+h format. See Sending a message with STO for details.
X-Mailgun-Time-Zone-Localize Toggles TZO on a per-message basis. String should be set to preferred delivery time in HH:mm or hh:mmaa format, where HH:mm is used for 24 hour format without AM/PM and hh:mmaa is used for 12 hour format with AM/PM. See Sending a message with TZO for details.

Was this answer helpful?

« Back