Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
14ee3cf2
Kaydet (Commit)
14ee3cf2
authored
Nis 13, 2013
tarafından
R David Murray
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#2118: clarify smtplib exception documentation.
üst
4bb17348
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
14 deletions
+19
-14
smtplib.rst
Doc/library/smtplib.rst
+16
-12
smtplib.py
Lib/smtplib.py
+3
-2
No files found.
Doc/library/smtplib.rst
Dosyayı görüntüle @
14ee3cf2
...
@@ -25,8 +25,9 @@ Protocol) and :rfc:`1869` (SMTP Service Extensions).
...
@@ -25,8 +25,9 @@ Protocol) and :rfc:`1869` (SMTP Service Extensions).
A :class:`SMTP` instance encapsulates an SMTP connection. It has methods
A :class:`SMTP` instance encapsulates an SMTP connection. It has methods
that support a full repertoire of SMTP and ESMTP operations. If the optional
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
host and port parameters are given, the SMTP :meth:`connect` method is called
with those parameters during initialization. An :exc:`SMTPConnectError` is
with those parameters during initialization. If the :meth:`connect` call
raised if the specified host doesn't respond correctly. The optional
returns anything other than a success code, an :exc:`SMTPConnectError` is
raised. The optional
*timeout* parameter specifies a timeout in seconds for blocking operations
*timeout* parameter specifies a timeout in seconds for blocking operations
like the connection attempt (if not specified, the global default timeout
like the connection attempt (if not specified, the global default timeout
setting will be used). The optional source_address parameter allows to bind to some
setting will be used). The optional source_address parameter allows to bind to some
...
@@ -103,7 +104,8 @@ A nice selection of exceptions is defined as well:
...
@@ -103,7 +104,8 @@ A nice selection of exceptions is defined as well:
.. exception:: SMTPException
.. exception:: SMTPException
Base exception class for all exceptions raised by this module.
The base exception class for all the other excpetions provided by this
module.
.. exception:: SMTPServerDisconnected
.. exception:: SMTPServerDisconnected
...
@@ -182,15 +184,6 @@ An :class:`SMTP` instance has the following methods:
...
@@ -182,15 +184,6 @@ An :class:`SMTP` instance has the following methods:
for connection and for all messages sent to and received from the server.
for connection and for all messages sent to and received from the server.
.. method:: SMTP.connect(host='localhost', port=0)
Connect to a host on a given port. The defaults are to connect to the local
host at the standard SMTP port (25). If the hostname ends with a colon (``':'``)
followed by a number, that suffix will be stripped off and the number
interpreted as the port number to use. This method is automatically invoked by
the constructor if a host is specified during instantiation.
.. method:: SMTP.docmd(cmd, args='')
.. method:: SMTP.docmd(cmd, args='')
Send a command *cmd* to the server. The optional argument *args* is simply
Send a command *cmd* to the server. The optional argument *args* is simply
...
@@ -207,6 +200,17 @@ An :class:`SMTP` instance has the following methods:
...
@@ -207,6 +200,17 @@ An :class:`SMTP` instance has the following methods:
:exc:`SMTPServerDisconnected` will be raised.
:exc:`SMTPServerDisconnected` will be raised.
.. method:: SMTP.connect(host='localhost', port=0)
Connect to a host on a given port. The defaults are to connect to the local
host at the standard SMTP port (25). If the hostname ends with a colon (``':'``)
followed by a number, that suffix will be stripped off and the number
interpreted as the port number to use. This method is automatically invoked by
the constructor if a host is specified during instantiation. Returns a
2-tuple of the response code and message sent by the server in its
connection response.
.. method:: SMTP.helo(name='')
.. method:: SMTP.helo(name='')
Identify yourself to the SMTP server using ``HELO``. The hostname argument
Identify yourself to the SMTP server using ``HELO``. The hostname argument
...
...
Lib/smtplib.py
Dosyayı görüntüle @
14ee3cf2
...
@@ -221,8 +221,9 @@ class SMTP:
...
@@ -221,8 +221,9 @@ class SMTP:
If specified, `host' is the name of the remote host to which to
If specified, `host' is the name of the remote host to which to
connect. If specified, `port' specifies the port to which to connect.
connect. If specified, `port' specifies the port to which to connect.
By default, smtplib.SMTP_PORT is used. An SMTPConnectError is raised
By default, smtplib.SMTP_PORT is used. If a host is specified the
if the specified `host' doesn't respond correctly. If specified,
connect method is called, and if it returns anything other than
a success code an SMTPConnectError is raised. If specified,
`local_hostname` is used as the FQDN of the local host. By default,
`local_hostname` is used as the FQDN of the local host. By default,
the local hostname is found using socket.getfqdn(). The
the local hostname is found using socket.getfqdn(). The
`source_address` parameter takes a 2-tuple (host, port) for the socket
`source_address` parameter takes a 2-tuple (host, port) for the socket
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment