MailNotifyEntity (smtp/notify.py)

core · homeassistant/components/smtp/notify.py · python · Apache-2.0
email

Implements SMTP notification service for Home Assistant.

# Source: https://github.com/home-assistant/core | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
"""Mail (SMTP) notification service."""

import asyncio
from contextlib import suppress
from email.message import EmailMessage
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import email.utils
import logging
from smtplib import SMTPException, SMTPServerDisconnected
from ssl import SSLContext
from typing import TYPE_CHECKING, Any, override

import aiosmtplib
import probatio

from homeassistant.components.notify import (
    ATTR_DATA,
    ATTR_TARGET,
    ATTR_TITLE,
    ATTR_TITLE_DEFAULT,
    PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
    BaseNotifi

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key