Skip to content
Email Notifications

Email Notifications

Deprecated Email Notification Options

The following legacy email notification options are deprecated and subject to removal with the release of Watchtower v2:

Use the notification-url configuration option with a smtp:// Shoutrrr URL instead.

Use the legacy notifications migration tool to help with migrating to a Shoutrrr URL.

Overview

Watchtower uses Shoutrrr’s SMTP service to send email notifications.

Examples

services:
watchtower:
    image: nickfedor/watchtower:latest
    environment:
    WATCHTOWER_NOTIFICATION_URL: smtp://user:secret@smtp.example.com:587/?fromaddress=sender@example.com&toaddresses=recipient@example.com
    volumes:
    - /var/run/docker.sock:/var/run/docker.sock

/// details | The following legacy SMTP configuration examples are deprecated and will be removed with the release of Watchtower v2. type: warning

services:
watchtower:
    image: nickfedor/watchtower:latest
    environment:
    WATCHTOWER_NOTIFICATIONS: email
    WATCHTOWER_NOTIFICATION_EMAIL_FROM: sender@example.com
    WATCHTOWER_NOTIFICATION_EMAIL_TO: recipient@example.com
    WATCHTOWER_NOTIFICATION_EMAIL_SERVER: smtp.example.com
    WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PORT: 587
    WATCHTOWER_NOTIFICATION_EMAIL_SERVER_USER: user
    WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD: secret
    WATCHTOWER_NOTIFICATION_EMAIL_DELAY: 10
    volumes:
    - /var/run/docker.sock:/var/run/docker.sock

///

Common SMTP Configurations

Property Value
Port 587
Encryption ExplicitTLS
UseStartTLS Yes
smtp://${USER}:${PASSWORD}@smtp.gmail.com:587/?fromaddress=${FROM}&toaddresses=${TO}&encryption=ExplicitTLS&usestarttls=yes&timeout=30s
For Gmail, use an App Password if two-factor authentication is enabled.

Notes

  • Timeout:

    • The default SMTP timeout is 10 seconds.
    • If you experience timeouts (e.g., failed to send: timed out: using smtp), add &timeout=30s to the URL to allow more time for server responses, especially with proxies or slow networks.
  • Authentication:

    • Use &auth=Plain for username/password authentication (default if credentials provided).
    • For OAuth2 (e.g., Gmail with app-specific passwords), use &auth=OAuth2.
  • Testing:

    • Install Shoutrrr using one of the various installation methods.

    • Test your URL with the Shoutrrr CLI:

      shoutrrr send -u <URL> -m "Test message"
  • Proxy Issues:

    • If using a Docker proxy (e.g., tcp://dockerproxy:2375), ensure it allows outbound connections to ${SMTP_HOST}:${SMTP_PORT}.
    • Test connectivity with telnet ${SMTP_HOST} ${SMTP_PORT} inside the container.
Last updated on