Simple and complete library for sending emails
A wrapper that manages the SMTP network connection.
Closes the connection to the email server.
Ensures we have a connection to the email server. Returns whether or not a new connection was required (True or False).
Sends one or more EmailMessage objects and returns the number of email messages sent.
A container for email information.
Initialize a single email message (which can be sent to multiple recipients).
All strings used to create the message can be unicode strings (or UTF-8 bytestrings). The SafeMIMEText class will handle any necessary encoding conversions.
Attaches a file with the given filename and content. The filename can be omitted (useful for multipart/alternative messages) and the mimetype is guessed, if not provided.
If the first parameter is a MIMEBase subclass it is inserted directly into the resulting message attachments.
Attaches a file from the filesystem.
Returns a list of all recipients of the email (includes direct addressees as well as Bcc entries).
Sends the email message.
A version of EmailMessage that makes it easy to send multipart/alternative messages. For example, including text and HTML versions of the text is made easier.
Initialize a single email message (which can be sent to multiple recipients).
All strings used to create the message can be unicode strings (or UTF-8 bytestrings). The SafeMIMEText class will handle any necessary encoding conversions.
Attach an alternative content representation.
Easy wrapper for sending a single message to a recipient list. All members of the recipient list will see the other recipients in the ‘To’ field.
Note: The API for this method is frozen. New code wanting to extend the functionality should use the EmailMessage class directly.
Given a datatuple of (subject, message, sender, recipient_list), sends each message to each recipient list. Returns the number of e-mails sent.
If auth_user and auth_password are set, they’re used to log in.
Note: The API for this method is frozen. New code wanting to extend the functionality should use the EmailMessage class directly.