From the course: Python Projects
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Send an email - Python Tutorial
From the course: Python Projects
Send an email
- [Instructor] Now that I have a function to format my daily digest content into an email message, it's time to implement the send email function to actually send an email. The Python standard library includes an email package which is a library for managing email messages. That package contains several modules. And for my implementation, I'll be using the email.message module to represent the email message itself. At the heart of this module is a class called, "Email Message," which is what I'll use to assemble the various parts of my daily digest email, such as the subject line, list of recipients, and of course, the message content itself. Now, going back up a level to the email package, as the documentation points out, while this package can help manage email messages, it is not designed to actually send those messages. That functionality is included in other Python modules, such as SMTP-Lib. This module can be used to set up a client session to send mail through an SMTP server…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.