SMTP

The SMTP integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] allows you to deliver notifications from Home Assistant to an email recipient.

Configuration

To add the SMTP service to your Home Assistant instance, use this My button:

Manual configuration steps

If the above My button doesn’t work, you can also perform the following steps manually:

Check your email provider configuration or help pages to get the correct SMTP settings.

Sender email

Email address that will appear in the From field.

Sender name

Display name shown as the email sender.

Host

Hostname or IP address of your SMTP server. For example, smtp.example.com.

Port

Port number used by your SMTP server. Common values are 587 (STARTTLS) and 465 (TLS).

Connection security

Encryption method used for the SMTP connection. starttls upgrades a plain connection to encrypted (recommended). tls uses encryption from the start. none sends without encryption.

Username

Username used to authenticate with the SMTP server.

Password

Password or app-specific password for the SMTP account.

Verify SSL certificate

Enable certificate verification for secure SSL/TLS connections.

Configuration options

The integration provides the following configuration options:

Connection timeout

Maximum time in seconds to wait for a response from the SMTP server before the connection attempt is aborted. Defaults to 5 seconds. Must be between 1 and 1800 seconds (30 minutes).

Adding recipients

You need to add at least one recipient email address. During the integration setup, you will be asked to add your first recipient email address. Additional recipients can be added later. Recipients are managed separately and can be added, edited, or removed at any time.

  1. Go to Settings > Devices & services and select the SMTP integration.
  2. Select Add recipient.
  3. Enter the email address you want to send notifications to.
  4. Select Submit.

Repeat these steps to add more recipients. Every email address you add can be selected as target for the corresponding integration.

Specific email provider configuration

Check below some configurations examples for specific email providers. If you are in doubt about the SMTP settings required, check your email provider configuration or help pages for more information about its specific SMTP configuration.

Google Mail

Example configuration for Google Mail.

Parameter Value
Host smtp.gmail.com
Port 587
Sender email example@gmail.com
Sender name sender name
Connection security STARTTLS
Username example@gmail.com
Password your app password

Google has some extra layers of protection that need special attention. You must use an application-specific password in your notification configuration.

To be able to create an app password:

  • You must have 2-step verification enabled on your account with another authentication mechanism than security key.
  • Your Google account must not be enrolled in Google’s Advanced Protection Program.
  • Your Google account must not belong to a Google Workspace that has disabled this feature. Accounts owned by a school, business, or other organization are examples of Google Workspace accounts.

Supported functionality

Notifiers

The SMTP integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] will add a notify entityAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more] for each configured recipient. To send a notification, you can use the Send a notification message (notify.send_message) actionActions are used in several places in Home Assistant. As part of a script or automation, actions define what is going to happen once a trigger is activated. In scripts, an action is called sequence. [Learn more]. For more customizable notifications, use the SMTP: Send message (smtp.send_message) instead.

ActionActions are used in several places in Home Assistant. As part of a script or automation, actions define what is going to happen once a trigger is activated. In scripts, an action is called *sequence*. [Learn more]
action: notify.send_message
data:
  title: "Reminder Have you considered frogs?"
  message: "Just checking in. Have you considered frogs today? If not, there's still time."
target:
  entity_id: notify.my_email

List of actions

The SMTP integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] provides the following actions. Each link below opens a dedicated page with examples, parameters, and a step-by-step UI walkthrough.

  • Send message (smtp.send_message) Send an email notification. Optionally use HTML formatting and include inline images or attach images and other files.

For an overview of every action across all integrations, see the actions reference.

SMTP automation examples

You can use this integration to create automations that send a notification to your email address when something happens.

Tip

You don’t need to edit YAML to use these examples. Copy a YAML snippet from this page, open the automation editor in Home Assistant, and press Ctrl+V (or Cmd+V on Mac). Home Assistant automatically converts the pasted YAML into the visual editor format, whether it’s a full automation, a single trigger, a condition, or an action.

Automation: send an email message when front door opens

This automation sends a notification message to an email address when the front door opens.

  • Trigger: State
    • Entity: Front door binary sensor
    • To: On
  • Action: Send a notification message
    • Target: My email address (notify.my_email)
YAML example for email notification when door opens
AutomationAutomations in Home Assistant allow you to automatically respond to things that happen in and around your home. [Learn more]
alias: "Notify by email: front door opened"
triggers:
  - trigger: door.opened
    target:
      entity_id: binary_sensor.front_door
actions:
  - action: notify.send_message
    target:
      entity_id: notify.my_email
    data:
      title: "Alert: Front Door Opened"
      message: >
        The front door was opened at {{ now().strftime('%Y-%m-%d %H:%M:%S') }}.

Known limitations

  • The SMTP integration does not currently support OAuth 2.0 authentication.

Troubleshooting

The SMTP integration requires network connectivity to the configured SMTP server. If you use a mail server on the internet, verify that your internet connection is stable. Your email service provider may also experience downtime, including scheduled maintenance.

When reporting an issue, enable debug logging. Reload the integration. As soon as the issue reoccurs, stop debug logging again. The debug log file will be downloaded automatically.

Removing the integration

This integration follows standard integration removal.

To remove an integration instance from Home Assistant

  1. Go to Settings > Devices & services and select the integration card.
  2. From the list of devices, select the integration instance you want to remove.
  3. Next to the entry, select the three dots menu. Then, select Delete.