SMTP.starttls()
SMTP.starttls() is a Python method in the Smtplib Module category. Puts the SMTP connection in TLS mode for encrypted communication. The syntax is SMTP.starttls(keyfile=None, certfile=None, context=None). Returns: Server response tuple. A typical example: server.starttls(context=ssl.create_default_context()). A close sibling is smtplib.SMTP(), which creates an SMTP client for sending emails. A close sibling is SMTP.sendmail(), which sends an email message from one address to one or more recipients. A close sibling is SMTP.login(), which authenticates to the SMTP server using a username and password. A close sibling is SMTP.quit(), which closes the SMTP connection gracefully. More about this category: SMTP email sending — SMTP, sendmail, login, quit. Related Smtplib Module entries: smtplib.SMTP(), SMTP.sendmail(), SMTP.login(), SMTP.quit(), SMTP.ehlo(), smtplib.SMTP_SSL(). This page is part of the free Python Reference documentation covering 978+ functions, methods, and modules with examples and parameter details. You can try SMTP.starttls() immediately in the Python playground, look up unfamiliar terms in the glossary, or return to the Python Reference homepage.