# 11.9 `smtplib` -- SMTP protocol client.

The `smtplib` module defines an SMTP client session object that can be used to send mail to any Internet machine with an SMTP or ESMTP listener daemon. For details of SMTP and ESMTP operation, consult RFC 821 (Simple Mail Transfer Protocol) and RFC 1869 (SMTP Service Extensions).

`SMTP` ([host[, port]])
  A `SMTP` instance encapsulates an SMTP connection. It has methods that support a full repertoire of SMTP and ESMTP operations. If the optional host and port parameters are given, the SMTP `connect()` method is called with those parameters during initialization. An `SMTPConnectError` is raised if the specified host doesn't respond correctly.

  For normal use, you should only require the initialization/connect, `sendmail()`, and `quit()` methods. An example is included below.

- 11.9.1 SMTP Objects
- 11.9.2 SMTP Example