Aller au contenu

Email Notifications

Ce contenu n’est pas encore disponible dans votre langue.

Overview

Valid syntax is as follows:

  • mailto://{user}:{password}@{domain}
  • mailto://{user}:{password}@{domain}:{port}
  • mailto://{domain}?user={user}&pass={password}
  • mailto://{user}:{password}@{domain}/{to_email}
  • mailto://{user}:{password}@{domain}/{to_email1}/{to_email2}/{to_emailN}

Adding an s to the schema (i.e. mailtos://) switches to a secure STARTTLS connection (port 587 by default):

  • mailtos://{user}:{password}@{domain}
  • mailtos://{user}:{password}@{domain}:{port}
  • mailtos://{domain}?user={user}&pass={password}
  • mailtos://{user}:{password}@{domain}/{to_email}
  • mailtos://{user}:{password}@{domain}/{to_email1}/{to_email2}/{to_emailN}

Apprise automatically detects many email providers based on the From address derived from your URL.
When a provider is recognized, Apprise automatically configures:

  • SMTP host
  • Port
  • Secure mode (SSL or STARTTLS)
  • Login format (full email vs user id)

In most cases, you only need to provide your email and password.

ProviderExample URLNotes
Google (Gmail)mailto://user:app-password@gmail.comIf 2-Step Verification is enabled, generate an App Password: https://security.google.com/settings/security/apppasswords
Yahoomailto://user:app-password@yahoo.comRequires an App Password: https://help.yahoo.com/kb/SLN15241.html
Fastmailmailto://user:app-password@fastmail.comApp Password must permit SMTP. See supported domains here.
GMXmailto://user:password@gmx.netAlso supports gmx.com, gmx.de, gmx.at, gmx.ch, gmx.fr.
Zohomailto://user:password@zoho.comProvider defaults are applied automatically.
Yandexmailto://user:password@yandex.comLogin may be user-id based depending on domain rules.
SendGrid (SMTP)mailto://apikey:password@sendgrid.com?from=noreply@yourdomain.comfrom= must use a validated sender identity.
QQ / Foxmailmailto://user:password@qq.comProvider defaults are applied automatically.
163.commailto://user:password@163.comProvider defaults are applied automatically.
Microsoft (Outlook, Hotmail, Office 365)Use azure:// insteadMicrosoft disabled SMTP basic authentication. Use the azure:// plugin.

This is not an exhaustive list. Additional domains are automatically detected when supported.

Email addresses may be written as:

  • user@example.com
  • Optional Name<user@example.com>

This syntax works in:

  • URL targets
  • from=
  • cc=
  • bcc=
  • reply=

If you need spaces inside a URL, encode them as %20.

Example:

from=Optional%20Name<noreply@example.com>
What you specifyWhat happens
No targets and no to=Apprise sends the email to the sender address (the derived From email).
Targets in the URL pathEach target becomes a recipient.
to= in the query stringTreated as an additional recipient (same as adding a target).
cc= / bcc=Applied to each generated email.
reply=Sets the Reply-To header (can be multiple).

If your provider is not automatically detected, configure SMTP manually.

Defaults:

  • mailto://: defaults to port 25
  • mailtos://: defaults to port 587 using STARTTLS

Most public providers require TLS. Prefer mailtos:// for external servers.

Send using a custom SMTP host:

  • mailtos://user:password@server.com?smtp=smtp.server.com&from=noreply@server.com

Include a From display name:

  • mailtos://user:password@server.com?smtp=smtp.server.com&from=Optional%20Name<noreply@server.com>

Force SSL (usually port 465):

  • mailtos://user:password@server.com:465?smtp=smtp.server.com&mode=ssl&from=noreply@server.com

If you run Postfix, Exim, or another internal relay that does not require authentication, omit user and pass.

mailto://localhost?from=john@example.ca

Internal relay host:

mailto://relay-server?from=noreply@example.com&to=alerts@example.com

If the SMTP host differs from the URL host:

mailto://server.com?smtp=smtp.server.com&from=noreply@server.com

If you want to set a display name, you can use either:

  • from=Optional%20Name<noreply@example.com> (preferred)
  • name=Optional%20Name&from=noreply@example.com

If both are provided, the name embedded in from= takes precedence.

Email supports custom header injection by prefixing query keys with a plus symbol (+).

This is useful for mail filters, internal routing, and tagging.

Set:

  • X-Token: abcdefg
Terminal window
apprise -vv -t "Test Message Title" -b "Test Message Body" \
"mailto://localhost?to=john@example.ca&+X-Token=abcdefg"

If you need to control some of the headers being sent to the mail server, you can simply generate keyword arguments that are prefixed with the plus (+) symbol.

For example, assuming you wanted to also pass along the following email headers (in your payload):

  • X-Token: abcdefg
  • X-Apprise: is great

You would structure your email like so:

Terminal window
apprise -vv -t "Test Message Title" -b "Test Message Body" \
"mailto://localhost?to=john@example.ca&+X-Token=abcdefg&+X-Apprise=is%20great"
  • Header values must be URL-encoded when they contain spaces.
  • Apprise automatically sets X-Application and merges in any headers you define.

By default, mailto://user:pass@domain sends to user@domain unless to= is specified.

Send to multiple recipients using either query form or path form:

  • mailto://user:pass@domain/?to=target@example.com,target2@example.com
  • mailto://user:pass@domain/target@example.com/target2@example.com
  • mailto://user:pass@domain/Accounting<accounting@example.com>/Billing<billing@example.com>

There is no hard-coded limit to recipient count, though your SMTP server may impose one.

cc= and bcc= apply to every email sent. If you notify 3 recipients, the same cc and bcc lists are used for each generated email.

Attachments are fully supported.

SMTP provider limits may apply. Apprise does not impose attachment size restrictions.

VariableRequiredDescription
userYes*SMTP username. May be a user id or a full email address. Can also be specified as ?user=.
passYes*SMTP password. Can also be specified as ?pass=.
domainYesDomain portion of the URL host. For mailto://user:pass@example.com, the domain is example.com.
portNoSMTP port. Defaults to 25 (mailto) and 587 (mailtos) unless provider defaults are applied.
smtpNoOverride the SMTP host. If set, provider detection is bypassed.
fromNoFrom address. Supports Optional Name<email@example.com>. Maps to the email From header.
nameNoLegacy alias for the From name. If both from= and name= are provided, from= takes precedence.
toNoRecipient override. Also supported via URL path targets.
ccNoCarbon Copy recipients. Comma separated. Name formatting is supported.
bccNoBlind Carbon Copy recipients. Comma separated. Name formatting is supported.
replyNoReply-To recipients. Comma separated. Name formatting is supported.
modeNoSecure mode: ssl or starttls. When using mailto://, specifying mode= upgrades to a secure connection.
pgpNoEnable PGP encryption (yes or no). Defaults to no.
pgpkeyNoPath to a PGP public key (input key: pgpkey). Treated as sensitive.
+HeaderNoAdd custom email headers by prefixing keys with +. Example: ?+X-Team=Ops.

* Not required for anonymous relays.

To avoid ambiguity, any URL parameter (?key=value) overrides values in the main URL:

  • mailto://usera:pass123@domain.com?user=foobar: the user of foobar would over-ride the user usera specified. However since the password was not over-ridden, the password of pass123 would be used still.
VariableDescription
overflowThis parameter can be set to either split, truncate, or upstream. This determines how Apprise delivers the message you pass it. By default this is set to upstream
👉 upstream: Do nothing at all; pass the message exactly as you received it to the service.
👉 truncate: Ensure that the message will fit within the service’s documented upstream message limit. If more information was passed then the defined limit, the overhead information is truncated.
👉 split: similar to truncate except if the message doesn’t fit within the service’s documented upstream message limit, it is split into smaller chunks and they are all delivered sequentially there-after.
formatThis parameter can be set to either text, html, or markdown. Some services support the ability to post content by several different means. The default of this varies (it can be one of the 3 mentioned at any time depending on which service you choose). You can optionally force this setting to stray from the defaults if you wish. If the service doesn’t support different types of transmission formats, then this field is ignored.
verifyExternal requests made to secure locations (such as through the use of https) will have certificates associated with them. By default, Apprise will verify that these certificates are valid; if they are not then no notification will be sent to the source. In some occasions, a user might not have a certificate authority to verify the key against or they trust the source; in this case you will want to set this flag to no. By default it is set to yes.
ctoThis stands for Socket Connect Timeout. This is the number of seconds Requests will wait for your client to establish a connection to a remote machine (corresponding to the connect()) call on the socket. The default value is 4.0 seconds.
rtoThis stands for Socket Read Timeout. This is the number of seconds the client will wait for the server to send a response. The default value is 4.0 seconds.
emojisEnable Emoji support (such as providing :+1: would translate to 👍). By default this is set to no.
Note: Depending on server side settings, the administrator has the power to disable emoji support at a global level; but default this is not the case.
tzIdentify the IANA Time Zone Database you wish to operate as. By default this is detected based on the configuration the server hosting Apprise is running on. You can set this to things like America/Toronto, or any other properly formated Timezone describing your area.

Built-in provider example:

Terminal window
apprise -vv -t "Test Message Title" -b "Test Message Body" \
mailto:///example:mypassword@gmail.com

Send an email to a custom provider; since no smtp= was identified, the host example.com is also assumed to be the SMTP server.

Terminal window
# Assuming the {domain} is example.com
# Assuming the {user} is george
# Assuming the {password} is pass123
apprise -vv -t "Test Message Title" -b "Test Message Body" \
mailto://george:pass123@example.com
# The above URL could also have been written like:
# mailto://example.com?user=george&pass=pass123

If the SMTP Server differs from the domain (which is usually the case), your URL should include the ?smtp= keyword argument:

Terminal window
# Assuming the {domain} is example.com
# Assuming the {user} is george
# Assuming the {password} is pass123
apprise -vv -t "Test Message Title" -b "Test Message Body" \
mailto://george:pass123@example.com?smtp=smtp.example.com

In some cases, the {user} is an email address. In this case you can place this information in the URL parameters instead:

Terminal window
# Assuming the {domain} is example.com
# Assuming the {user} is george@example.com
# Assuming the {password} is pass123
apprise -vv -t "Test Message Title" -b "Test Message Body" \
"mailto://example.com?user=george@example.com&pass=pass123"
# Note that the ampersand (&) that is used in the URL to separate
# one argument from another is also interpreted by the CLI as
# run in the background. Wrap your URL in quotes.
# Send an email to a smtp relay server you are hosting:
apprise -vv -t "Test Message Title" -b "Test Message Body" \
mailto://localhost?from=john@example.ca

Users with custom SMTP Servers will require a slightly more complicated configuration:

Terminal window
# Assuming the {smtp_server} is mail.example.com
# Assuming the {send_from} is joe@example.com
# Assuming the {login} is user1@example.com
# Assuming the {password} is pass123
# Assuming you want to use starttls (port 587)
apprise -vv -t "Test Message Title" -b "Test Message Body" \
"mailtos://_?user=user1@example.com&pass=pass123&smtp=mail.example.com&from=joe@example.com"
# Notes (for above URL):
# - Since no `to=` was specified above, the `from` address is notified
# - mailtos:// defaults to starttls on 587; if you want to use port 465 (SSL)
# you would just need to add `mode=ssl` to the parameter of your URL.

Here is a more complicated example where you want to use ssl and a custom port

Terminal window
# Assuming the {smtp_server} is mail.example.com
# Assuming the {send_from} is joe@example.com
# Assuming the {login} is user1@example.com
# Assuming the {password} is pass123
# Assuming you want to use ssl on port 12522
# Assuming you want your email to go to bob@example.com and jane@yahoo.ca
apprise -vv -t "Test Message Title" -b "Test Message Body" \
"mailtos://example.com:12522?user=user1@example.com&pass=pass123&smtp=mail.example.com&from=joe@example.com&to=bob@example.com,jane@yahoo.ca&mode=ssl"
Local relay:
```bash
apprise -t "Test Title" -b "Test Body" \
mailto://localhost?to=john@example.com
Questions or Feedback?

Documentation

Notice a typo or an error? Report it or contribute a fix .

Technical Issues

Having trouble with the code? Open an issue on GitHub:

Made with love from Canada