Sending e-mail messages
The first and foremost thing that you may want to achieve with an e-mail client is to send a message to your friend's or colleague's e-mail address. Let's go ahead and see how we can achieve this in Python.
In order to send e-mail messages, we will need to have Python's
smtplib module. This library, as the name suggests, uses the SMTP protocol to send e-mail messages. We can install
smtplib with our favorite
pip tool with the following command. But Python's default installation should also have this module already:
pip install smtplib
How to do it...
- On your computer, open your favorite editor and add the following code snippet. Let this be known as
config.py. The configuration file has login details, such as ...