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

Skip to content

Commit aae8da1

Browse files
committed
Documentation for the new login() method of the smtplib.SMTP class,
contributed by Gerhard Häring. This is part of SF patch #460112.
1 parent 4270680 commit aae8da1

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Doc/lib/libsmtplib.tex

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,24 @@ \subsection{SMTP Objects \label{SMTP-objects}}
160160
Note: many sites disable SMTP \samp{VRFY} in order to foil spammers.
161161
\end{methoddesc}
162162

163+
\begin{methoddesc}{login}{user, password}
164+
Log in on an SMTP server that requires authentication.
165+
The arguments are the username and the password to authenticate with.
166+
If there has been no previous \samp{EHLO} or \samp{HELO} command this
167+
session, this method tries ESMTP \samp{EHLO} first.
168+
This method will return normally if the authentication was successful,
169+
or may raise the following exceptions:
170+
171+
\begin{description}
172+
\item[\exception{SMTPHeloError}]
173+
The server didn't reply properly to the \samp{HELO} greeting.
174+
\item[\exception{SMTPAuthenticationError}]
175+
The server didn't accept the username/password combination.
176+
\item[\exception{SMTPError}]
177+
No suitable authentication method was found.
178+
\end{description}
179+
\end{methoddesc}
180+
163181
\begin{methoddesc}{sendmail}{from_addr, to_addrs, msg\optional{,
164182
mail_options, rcpt_options}}
165183
Send mail. The required arguments are an \rfc{822} from-address

0 commit comments

Comments
 (0)