Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.smtp.notify.MailNotificationService Class Reference
Inheritance diagram for homeassistant.components.smtp.notify.MailNotificationService:
[legend]
Collaboration diagram for homeassistant.components.smtp.notify.MailNotificationService:
[legend]

Public Member Functions

def __init__ (self, server, port, timeout, sender, encryption, username, password, recipients, sender_name, debug, verify_ssl)
 
def connect (self)
 
def connection_is_valid (self)
 
def send_message (self, message="", **kwargs)
 

Public Attributes

 debug
 
 encryption
 
 password
 
 recipients
 
 tries
 
 username
 

Private Member Functions

def _send_email (self, msg, recipients)
 

Private Attributes

 _port
 
 _sender
 
 _sender_name
 
 _server
 
 _timeout
 
 _verify_ssl
 

Detailed Description

Implement the notification service for E-mail messages.

Definition at line 109 of file notify.py.

Constructor & Destructor Documentation

◆ __init__()

def homeassistant.components.smtp.notify.MailNotificationService.__init__ (   self,
  server,
  port,
  timeout,
  sender,
  encryption,
  username,
  password,
  recipients,
  sender_name,
  debug,
  verify_ssl 
)
Initialize the SMTP service.

Definition at line 112 of file notify.py.

Member Function Documentation

◆ _send_email()

def homeassistant.components.smtp.notify.MailNotificationService._send_email (   self,
  msg,
  recipients 
)
private
Send the message.

Definition at line 226 of file notify.py.

◆ connect()

def homeassistant.components.smtp.notify.MailNotificationService.connect (   self)
Connect/authenticate to SMTP Server.

Definition at line 140 of file notify.py.

◆ connection_is_valid()

def homeassistant.components.smtp.notify.MailNotificationService.connection_is_valid (   self)
Check for valid config, verify connectivity.

Definition at line 161 of file notify.py.

◆ send_message()

def homeassistant.components.smtp.notify.MailNotificationService.send_message (   self,
  message = "",
**  kwargs 
)
Build and send a message to a user.

Will send plain text normally, with pictures as attachments if images config is
defined, or will build a multipart HTML if html config is defined.

Definition at line 188 of file notify.py.

Member Data Documentation

◆ _port

homeassistant.components.smtp.notify.MailNotificationService._port
private

Definition at line 128 of file notify.py.

◆ _sender

homeassistant.components.smtp.notify.MailNotificationService._sender
private

Definition at line 130 of file notify.py.

◆ _sender_name

homeassistant.components.smtp.notify.MailNotificationService._sender_name
private

Definition at line 135 of file notify.py.

◆ _server

homeassistant.components.smtp.notify.MailNotificationService._server
private

Definition at line 127 of file notify.py.

◆ _timeout

homeassistant.components.smtp.notify.MailNotificationService._timeout
private

Definition at line 129 of file notify.py.

◆ _verify_ssl

homeassistant.components.smtp.notify.MailNotificationService._verify_ssl
private

Definition at line 137 of file notify.py.

◆ debug

homeassistant.components.smtp.notify.MailNotificationService.debug

Definition at line 136 of file notify.py.

◆ encryption

homeassistant.components.smtp.notify.MailNotificationService.encryption

Definition at line 131 of file notify.py.

◆ password

homeassistant.components.smtp.notify.MailNotificationService.password

Definition at line 133 of file notify.py.

◆ recipients

homeassistant.components.smtp.notify.MailNotificationService.recipients

Definition at line 134 of file notify.py.

◆ tries

homeassistant.components.smtp.notify.MailNotificationService.tries

Definition at line 138 of file notify.py.

◆ username

homeassistant.components.smtp.notify.MailNotificationService.username

Definition at line 132 of file notify.py.


The documentation for this class was generated from the following file: