Vinay Sajip avatar Vinay Sajip committed ba5bd8c

Closes #12667: Added documentation for SMTPHandler secure argument.

Comments (0)

Files changed (1)

Doc/library/logging.handlers.rst

 supports sending logging messages to an email address via SMTP.
 
 
-.. class:: SMTPHandler(mailhost, fromaddr, toaddrs, subject, credentials=None)
+.. class:: SMTPHandler(mailhost, fromaddr, toaddrs, subject, credentials=None, secure=None)
 
    Returns a new instance of the :class:`SMTPHandler` class. The instance is
    initialized with the from and to addresses and subject line of the email. The
    the standard SMTP port is used. If your SMTP server requires authentication, you
    can specify a (username, password) tuple for the *credentials* argument.
 
+   To specify the use of a secure protocol (TLS), pass in a tuple to the
+   *secure* argument. This will only be used when authentication credentials are
+   supplied. The tuple should be either an empty tuple, or a single-value tuple
+   with the name of a keyfile, or a 2-value tuple with the names of the keyfile
+   and certificate file. (This tuple is passed to the
+   :meth:`smtplib.SMTP.starttls` method.)
 
    .. method:: emit(record)
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.