simple_email.EmailClient

class simple_email.EmailClient(login: str, password: str, host: str, port: int)[source]

Email client that will be used to send and receive e-mails.

Example

>>> # `config` below refers to a hypothetical env file.
>>> email_client = EmailClient(login=config.EMAIL, password=config.EMAIL_AUTH,
                               host='smtp.office365.com', port=587)
__init__(login: str, password: str, host: str, port: int)[source]

Instatiate the credentials for the e-mail client without authenticating.

Parameters:
  • login – The e-mail address used to log in with your e-mail provider. E.g. ‘an_email_address@domain.com
  • password – The password associated with the login. For security, it is strongly recommended that this parameter be fed from an environment variable and NOT in plain text.
  • host – The smtp host name. E.g. ‘smtp.office365.com’ for Outlook365.
  • port – host’s port. E.g. 587 for Outlook365.

Methods

__init__(login, password, host, port) Instatiate the credentials for the e-mail client without authenticating.
send(msg[, from_addr, to_addrs, …]) Send an Email object as an e-mail.