PyDocs

Nav

Internet Protocols and Support

SMTP.login

smtplib

method of SMTP (source) not WASI
  • SMTP.login(user, password, *, initial_response_ok=True)
Log in on an SMTP server that requires authentication.

The arguments are:
    - user:         The user name to authenticate with.
    - password:     The password for the authentication.

Keyword arguments:
    - initial_response_ok: Allow sending the RFC 4954 initial-response
      to the AUTH command, if the authentication methods supports it.

If there has been no previous EHLO or HELO command this session, this
method tries ESMTP EHLO first.

This method will return normally if the authentication was successful.

This method may raise the following exceptions:

 SMTPHeloError            The server didn't reply properly to
                          the helo greeting.
 SMTPAuthenticationError  The server didn't accept the username/
                          password combination.
 SMTPNotSupportedError    The AUTH command is not supported by the
                          server.
 SMTPException            No suitable authentication method was
                          found.
Changed in 3.5
  • 3.5: SMTPNotSupportedError may be raised, and the initial_response_ok parameter was added.
0 Examples
No examples for smtplib/SMTP.login.
See Also
No see-alsos for smtplib/SMTP.login
0 Notes
No notes for SMTP.login