ExperimentSession.send_mail()#

ExperimentSession.send_mail(msg: email.message.EmailMessage, tls: bool = False)[source]#

Sends an email message using credentials defined in secrets.conf.

Parameters
  • msg (EmailMessage) – The msg is a EmailMessage objects that holds information on the subject, the recipient, and the text body.

  • tls (bool) – If True, will try to connect with the mail server over tls. If False (default), will try to connect over SSL.

Notes

Your secrets.conf must have a section [mail] with the following fields:

  • address: Sender email address.

  • name: Sender name.

  • password: Password to sender email account.

  • server: SMTP server address of sender’s email provider.

  • port: SMTP server port. If port is zero, the standard

    SMTP-over-SSL port (465) is used.