Mailgun
| Schemes | mailgun:// |
| Cargo feature | service-mailgun |
| Service | https://www.mailgun.com/ |
| Body formats | html (first is the default) |
| Attachments | yes |
| Title length | 250 characters |
| Body length | 32,768 characters |
| Body lines | unlimited |
| Request throttle | 200 ms between requests |
| Vendor URLs accepted | no |
URL formats
{schema}://{user}@{host}/{apikey}/
{schema}://{user}@{host}/{apikey}/{targets}
{schema} is one of mailgun://.
URL tokens
| Token | Meaning | Type | Required | Default | Notes |
|---|---|---|---|---|---|
{apikey} | API Key | string | yes | secret | |
{host} | Domain | string | yes | ||
{target_email} | Target Email | no | |||
{targets} | Targets | list | no | any of target_email; separated by / | |
{user} | User Name | string | yes |
Query parameters
| Parameter | Meaning | Type | Default | Notes |
|---|---|---|---|---|
batch | Batch Mode | bool | no | |
bcc | Blind Carbon Copy | list | separated by , or space | |
cc | Carbon Copy | list | separated by , or space | |
name | From Name | string | also from | |
region | Region Name | choice | us | one of us, eu |
to | Targets | list | sets {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.