Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Mailgun

Schemesmailgun://
Cargo featureservice-mailgun
Servicehttps://www.mailgun.com/
Body formatshtml (first is the default)
Attachmentsyes
Title length250 characters
Body length32,768 characters
Body linesunlimited
Request throttle200 ms between requests
Vendor URLs acceptedno

URL formats

{schema}://{user}@{host}/{apikey}/
{schema}://{user}@{host}/{apikey}/{targets}

{schema} is one of mailgun://.

URL tokens

TokenMeaningTypeRequiredDefaultNotes
{apikey}API Keystringyessecret
{host}Domainstringyes
{target_email}Target Emailemailno
{targets}Targetslistnoany of target_email; separated by /
{user}User Namestringyes

Query parameters

ParameterMeaningTypeDefaultNotes
batchBatch Modeboolno
bccBlind Carbon Copylistseparated by , or space
ccCarbon Copylistseparated by , or space
nameFrom Namestringalso from
regionRegion Namechoiceusone of us, eu
toTargetslistsets {targets}

Prefixed parameters:

  • +name=value: Email Header
  • :name=value: Template Tokens

The common URL parameters (format, overflow, verify, redirect, cto, rto, retry, wait, store, tag, tz, user, password, port, optional, emojis) apply as well.

Examples

Accepted URLs (tokens are fake):

mailgun://user@localhost.localdomain/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbb-cccccccc
mailgun://user@localhost.localdomain/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbb-cccccccc/test@example.com
mailgun://user@localhost.localdomain/apikey?verify=no
mailgun://no-reply@example.com/apikey/user1@example.com/User2:user2@example.com?batch=yes
mailgun://user@localhost.localdomain/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbb-cccccccc?region=uS
mailgun://user@localhost.localdomain/apikey?name=J%C3%B6rg
mailgun://user@localhost.localdomain/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbb-cccccccc?format=markdown
mailgun://user@localhost.localdomain/apikey?to=test@example.com

Rejected URLs:

mailgun://
mailgun://:@/
mailgun://user@localhost.localdomain
mailgun://localhost.localdomain/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbb-cccccccc

Send one from the command line:

mercurio -t 'Backup' -b 'Finished in 42s' 'mailgun://user@localhost.localdomain/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbb-cccccccc'

Notes

Mailgun (mailgun://): e-mail through the Mailgun API.

mailgun://{user}@{domain}/{apikey}[/{to_email}...] ?region=us|eu&from=..&name=..&cc=..&bcc=..&batch=yes&+Header=v&:token=v

+key=value entries become h:key e-mail headers, :key=value entries v:key template variables. Without targets the message goes to the sender.