SMTP.sendmail()
SMTP.sendmail() is a Python method in the Smtplib Module category. Sends an email message from one address to one or more recipients. The syntax is SMTP.sendmail(from_addr, to_addrs, msg, mail_options=[], rcpt_options=[]). Parameters: from_addr, to_addrs, msg. Returns: Dictionary of failures. A typical example: server.sendmail("sender@test.com", ["recipient@test.com"], msg.as_string()). A close sibling is smtplib.SMTP(), which creates an SMTP client for sending emails. A close sibling is SMTP.login(), which authenticates to the SMTP server using a username and password. A close sibling is SMTP.starttls(), which puts the SMTP connection in TLS mode for encrypted communication. 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.login(), SMTP.starttls(), 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.