mail.smtp

mail.smtp

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

Bases: MailOutPlugin

Plugin to interact with a mail server over SMTP.

__init__(server: Optional[str] = None, port: Optional[int] = None, local_hostname: Optional[str] = None, source_address: Optional[List[str]] = None, username: Optional[str] = None, password: Optional[str] = None, password_cmd: Optional[str] = None, access_token: Optional[str] = None, oauth_mechanism: Optional[str] = 'XOAUTH2', oauth_vendor: Optional[str] = None, ssl: bool = False, keyfile: Optional[str] = None, certfile: Optional[str] = None, timeout: Optional[int] = 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).