smtplib.SMTP.verify()

SMTP.verify(address) Check the validity of an address on this server using SMTP VRFY. Returns a tuple consisting of code 250 and a full RFC 822 address (including human name) if the user address is valid. Otherwise returns an SMTP error code of 400 or greater and an error string. Note Many sites disable SMTP VRFY in order to foil spammers.

smtplib.SMTP.starttls()

SMTP.starttls(keyfile=None, certfile=None, context=None) Put the SMTP connection in TLS (Transport Layer Security) mode. All SMTP commands that follow will be encrypted. You should then call ehlo() again. If keyfile and certfile are provided, these are passed to the socket module’s ssl() function. Optional context parameter is a ssl.SSLContext object; This is an alternative to using a keyfile and a certfile and if specified both keyfile and certfile should be None. If there has been no previ

smtplib.SMTP.set_debuglevel()

SMTP.set_debuglevel(level) Set the debug output level. A value of 1 or True for level results in debug messages for connection and for all messages sent to and received from the server. A value of 2 for level results in these messages being timestamped. Changed in version 3.5: Added debuglevel 2.

smtplib.SMTP.send_message()

SMTP.send_message(msg, from_addr=None, to_addrs=None, mail_options=[], rcpt_options=[]) This is a convenience method for calling sendmail() with the message represented by an email.message.Message object. The arguments have the same meaning as for sendmail(), except that msg is a Message object. If from_addr is None or to_addrs is None, send_message fills those arguments with addresses extracted from the headers of msg as specified in RFC 5322: from_addr is set to the Sender field if it is p

smtplib.SMTP.sendmail()

SMTP.sendmail(from_addr, to_addrs, msg, mail_options=[], rcpt_options=[]) Send mail. The required arguments are an RFC 822 from-address string, a list of RFC 822 to-address strings (a bare string will be treated as a list with 1 address), and a message string. The caller may pass a list of ESMTP options (such as 8bitmime) to be used in MAIL FROM commands as mail_options. ESMTP options (such as DSN commands) that should be used with all RCPT commands can be passed as rcpt_options. (If you nee

smtplib.SMTP.quit()

SMTP.quit() Terminate the SMTP session and close the connection. Return the result of the SMTP QUIT command.

smtplib.SMTP.login()

SMTP.login(user, password, *, initial_response_ok=True) Log in on an SMTP server that requires authentication. The arguments are the username and the password to authenticate with. 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, or may raise the following exceptions: SMTPHeloError The server didn’t reply properly to the HELO greeting. SMTPAuthenticationError The s

smtplib.SMTP.helo()

SMTP.helo(name='') Identify yourself to the SMTP server using HELO. The hostname argument defaults to the fully qualified domain name of the local host. The message returned by the server is stored as the helo_resp attribute of the object. In normal operation it should not be necessary to call this method explicitly. It will be implicitly called by the sendmail() when necessary.

smtplib.SMTP.has_extn()

SMTP.has_extn(name) Return True if name is in the set of SMTP service extensions returned by the server, False otherwise. Case is ignored.

smtplib.SMTP.ehlo_or_helo_if_needed()

SMTP.ehlo_or_helo_if_needed() This method call ehlo() and or helo() if there has been no previous EHLO or HELO command this session. It tries ESMTP EHLO first. SMTPHeloError The server didn’t reply properly to the HELO greeting.