O'Reilly logo

Python: Essential Reference, Third Edition by David Beazley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

smtplib

The smtplib module provides a low-level SMTP client interface that can be used to send mail using the SMTP protocol, described in RFC 821 and RFC 1869. This module contains a number of low-level functions and methods that are described in detail in the online documentation. However, the following covers the most useful parts of this module:

						SMTP([host
						[,
						port]])

Creates an object representing a connection to an SMTP server. If host is given, it specifies the name of the SMTP server. port is an optional port number. The default port is 25. If host is supplied, the connect() method is called automatically. Otherwise, you will need to manually call connect() on the returned object to establish the connection.

An instance, s, of SMTP has ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required