Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d25c1b73
Commit
d25c1b73
authored
Nov 28, 1999
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A bunch of docstring fixes.
parent
32efef33
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
23 deletions
+22
-23
Lib/smtplib.py
Lib/smtplib.py
+22
-23
No files found.
Lib/smtplib.py
View file @
d25c1b73
...
@@ -77,7 +77,7 @@ class SMTPResponseException(SMTPException):
...
@@ -77,7 +77,7 @@ class SMTPResponseException(SMTPException):
class
SMTPSenderRefused
(
SMTPResponseException
):
class
SMTPSenderRefused
(
SMTPResponseException
):
"""Sender address refused.
"""Sender address refused.
In addition to the attributes set by on all SMTPResponseException
In addition to the attributes set by on all SMTPResponseException
exceptions, this sets `sender' to the string that the SMTP refused
exceptions, this sets `sender' to the string that the SMTP refused
.
"""
"""
def
__init__
(
self
,
code
,
msg
,
sender
):
def
__init__
(
self
,
code
,
msg
,
sender
):
...
@@ -103,10 +103,10 @@ class SMTPDataError(SMTPResponseException):
...
@@ -103,10 +103,10 @@ class SMTPDataError(SMTPResponseException):
"""The SMTP server didn't accept the data."""
"""The SMTP server didn't accept the data."""
class
SMTPConnectError
(
SMTPResponseException
):
class
SMTPConnectError
(
SMTPResponseException
):
"""Error during connection establishment"""
"""Error during connection establishment
.
"""
class
SMTPHeloError
(
SMTPResponseException
):
class
SMTPHeloError
(
SMTPResponseException
):
"""The server refused our HELO reply"""
"""The server refused our HELO reply
.
"""
def
quoteaddr
(
addr
):
def
quoteaddr
(
addr
):
"""Quote a subset of the email addresses defined by RFC 821.
"""Quote a subset of the email addresses defined by RFC 821.
...
@@ -127,7 +127,7 @@ def quoteaddr(addr):
...
@@ -127,7 +127,7 @@ def quoteaddr(addr):
def
quotedata
(
data
):
def
quotedata
(
data
):
"""Quote data for email.
"""Quote data for email.
Double leading '.', and change Unix newline '
\
n
', or Mac '
\
r
' into
Double leading '.', and change Unix newline '
\
\
n', or Mac '
\
\
r' into
Internet CRLF end-of-line.
Internet CRLF end-of-line.
"""
"""
return
re
.
sub
(
r'(?m)^\
.
', '
..
',
return
re
.
sub
(
r'(?m)^\
.
', '
..
',
...
@@ -138,11 +138,11 @@ class SMTP:
...
@@ -138,11 +138,11 @@ class SMTP:
SMTP Objects:
SMTP Objects:
SMTP objects have the following attributes:
SMTP objects have the following attributes:
helo_resp
helo_resp
This is the message given by the server in respon
c
e to the
This is the message given by the server in respon
s
e to the
most recent HELO command.
most recent HELO command.
ehlo_resp
ehlo_resp
This is the message given by the server in respon
c
e to the
This is the message given by the server in respon
s
e to the
most recent EHLO command. This is usually multiline.
most recent EHLO command. This is usually multiline.
does_esmtp
does_esmtp
...
@@ -152,15 +152,15 @@ class SMTP:
...
@@ -152,15 +152,15 @@ class SMTP:
esmtp_features
esmtp_features
This is a dictionary, which, if the server supports ESMTP,
This is a dictionary, which, if the server supports ESMTP,
will _after you do an EHLO command_, contain the names of the
will _after you do an EHLO command_, contain the names of the
SMTP service
extentions this server supports, and their
SMTP service
extensions this server supports, and their
parameters (if any).
parameters (if any).
Note, all extention names are mapped to lower case in the
Note, all extension names are mapped to lower case in the
dictionary.
dictionary.
For method docs, see each method'
s
docstrings
.
In
general
,
there
is
See each method'
s
docstrings
for
details
.
In
general
,
there
is
a
a
method
of
the
same
name
to
perform
each
SMTP
command
,
and
there
method
of
the
same
name
to
perform
each
SMTP
command
.
There
is
also
a
is
a
method
called
'sendmail'
that
will
do
an
entire
mail
method
called
'sendmail'
that
will
do
an
entire
mail
transaction
.
transaction
.
"""
"""
debuglevel = 0
debuglevel = 0
file = None
file = None
...
@@ -173,8 +173,8 @@ class SMTP:
...
@@ -173,8 +173,8 @@ 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
By
default
,
smtplib
.
SMTP_PORT
is
used
.
An
SMTPConnectError
is
raised
raised
if
the
specified
`
host
' doesn'
t
respond
correctly
.
if
the
specified
`
host
' doesn'
t
respond
correctly
.
"""
"""
self.esmtp_features = {}
self.esmtp_features = {}
...
@@ -425,15 +425,14 @@ class SMTP:
...
@@ -425,15 +425,14 @@ class SMTP:
This
method
will
return
normally
if
the
mail
is
accepted
for
at
least
This
method
will
return
normally
if
the
mail
is
accepted
for
at
least
one
recipient
.
It
returns
a
dictionary
,
with
one
entry
for
each
one
recipient
.
It
returns
a
dictionary
,
with
one
entry
for
each
recipient
that
was
refused
.
Each
entry
contains
a
tuple
of
recipient
that
was
refused
.
Each
entry
contains
a
tuple
of
the
SMTP
the
SMTP
error
code
and
the
accompanying
error
message
sent
by
error
code
and
the
accompanying
error
message
sent
by
the
server
.
the
server
.
This
method
may
raise
the
following
exceptions
:
This
method
may
raise
the
following
exceptions
:
SMTPHeloError
The
server
didn
't reply properly to
SMTPHeloError
The
server
didn
't reply properly to
the helo greeting.
the helo greeting.
SMTPRecipientsRefused The server rejected
for
ALL recipients
SMTPRecipientsRefused The server rejected ALL recipients
(no mail was sent).
(no mail was sent).
SMTPSenderRefused The server didn'
t
accept
the
from_addr
.
SMTPSenderRefused The server didn'
t
accept
the
from_addr
.
SMTPDataError
The
server
replied
with
an
unexpected
SMTPDataError
The
server
replied
with
an
unexpected
...
...
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