Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9525956

Browse files
committed
Closes #12667: Added documentation for SMTPHandler secure argument.
1 parent 222e61e commit 9525956

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Doc/library/logging.handlers.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ The :class:`SMTPHandler` class, located in the :mod:`logging.handlers` module,
614614
supports sending logging messages to an email address via SMTP.
615615

616616

617-
.. class:: SMTPHandler(mailhost, fromaddr, toaddrs, subject, credentials=None)
617+
.. class:: SMTPHandler(mailhost, fromaddr, toaddrs, subject, credentials=None, secure=None)
618618

619619
Returns a new instance of the :class:`SMTPHandler` class. The instance is
620620
initialized with the from and to addresses and subject line of the email. The
@@ -623,6 +623,12 @@ supports sending logging messages to an email address via SMTP.
623623
the standard SMTP port is used. If your SMTP server requires authentication, you
624624
can specify a (username, password) tuple for the *credentials* argument.
625625

626+
To specify the use of a secure protocol (TLS), pass in a tuple to the
627+
*secure* argument. This will only be used when authentication credentials are
628+
supplied. The tuple should be either an empty tuple, or a single-value tuple
629+
with the name of a keyfile, or a 2-value tuple with the names of the keyfile
630+
and certificate file. (This tuple is passed to the
631+
:meth:`smtplib.SMTP.starttls` method.)
626632

627633
.. method:: emit(record)
628634

0 commit comments

Comments
 (0)