-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
gh-137339: Clarify host and port parameter behavior in smtplib.SMTP_SSL initialization #137340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,10 @@ | |
An :class:`SMTP` instance encapsulates an SMTP connection. It has methods | ||
that support a full repertoire of SMTP and ESMTP operations. If the optional | ||
*host* and *port* parameters are given, the SMTP :meth:`connect` method is | ||
called with those parameters during initialization. If specified, | ||
called with those parameters during initialization.If *host* is omitted or | ||
an empty string, no connection is made during initialization; you must | ||
call :meth:`connect` manually before using the instance. | ||
If *port* is zero, the default SMTP port (25) is used. 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 | ||
:func:`socket.getfqdn`. If the :meth:`connect` call returns anything other | ||
|
@@ -78,10 +81,13 @@ | |
.. class:: SMTP_SSL(host='', port=0, local_hostname=None, * [, timeout], \ | ||
context=None, source_address=None) | ||
|
||
An :class:`SMTP_SSL` instance behaves exactly the same as instances of | ||
Check warning on line 84 in Doc/library/smtplib.rst
|
||
:class:`SMTP`. :class:`SMTP_SSL` should be used for situations where SSL is | ||
required from the beginning of the connection and using :meth:`starttls` is | ||
not appropriate. If *host* is not specified, the local host is used. If | ||
not appropriate. If the optional *host* and *port* parameters are given, the | ||
SMTP_SSL :meth:`connect` method is called with those parameters during initialization. | ||
If *host* is omitted or an empty string, no connection is made during initialization; | ||
you must call :meth:`connect` manually before using the instance. If | ||
*port* is zero, the standard SMTP-over-SSL port (465) is used. The optional | ||
arguments *local_hostname*, *timeout* and *source_address* have the same | ||
meaning as they do in the :class:`SMTP` class. *context*, also optional, | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already hinted in the previous sentence and this would somehow conflict with the last sentence IMO.