mail.smtp#

class platypush.plugins.mail.smtp.MailSmtpPlugin(server: str | None = None, port: int | None = None, local_hostname: str | None = None, source_address: List[str] | None = None, username: str | None = None, password: str | None = None, password_cmd: str | None = None, access_token: str | None = None, oauth_mechanism: str | None = 'XOAUTH2', oauth_vendor: str | None = None, ssl: bool = False, keyfile: str | None = None, certfile: str | None = None, timeout: int | None = 60, **kwargs)[source]#

Bases: MailOutPlugin

Plugin to interact with a mail server over SMTP.

__init__(server: str | None = None, port: int | None = None, local_hostname: str | None = None, source_address: List[str] | None = None, username: str | None = None, password: str | None = None, password_cmd: str | None = None, access_token: str | None = None, oauth_mechanism: str | None = 'XOAUTH2', oauth_vendor: str | None = None, ssl: bool = False, keyfile: str | None = None, certfile: str | None = None, timeout: int | None = 60, **kwargs)[source]#
Parameters:
  • server – Server name/address.

  • port – Port (default: 25 for plain, 465 for SSL).

  • local_hostname – If specified, local_hostname is used as the FQDN of the local host in the HELO/EHLO command. Otherwise, the local hostname is found using socket.getfqdn().

  • source_address – The optional source_address parameter allows binding to some specific source address in a machine with multiple network interfaces, and/or to some specific source TCP port. It takes a 2-tuple (host, port), for the socket to bind to as its source address before connecting. If omitted (or if host or port are ‘’ and/or 0 respectively) the OS default behavior will be used.

  • username – SMTP username.

  • password – SMTP password.

  • password_cmd – If you don’t want to input your password in the configuration, run this command to fetch or decrypt the password.

  • access_token – OAuth2 access token if the server supports OAuth authentication.

  • oauth_mechanism – OAuth2 mechanism (default: XOAUTH2).

  • oauth_vendor – OAuth2 vendor (default: None).

  • ssl – Use SSL (default: False).

  • keyfile – Private key file for SSL connection if client authentication is required.

  • certfile – SSL certificate file or chain.

  • timeout – Server connect/read timeout in seconds (default: 60).