This is mostly meant to be used by email clients on your phone or computer (like Outlook, Thunderbird, etc). SMTP is usually just provided as an outward-facing interface to their service via the server. I should note that many email services, like Gmail, don't usually use SMTP on their internal mail servers. If you want to retrieve email instead, then you'll want to check out the IMAP (Internet Message Access Protocol) protocol. SMTP is a delivery protocol only, so you can't actually retrieve email with it, you can only send email, which is what we'll be focusing on in this article. SMTP (Simple Mail Transfer Protocol) is an application-level protocol (on top of TCP) used to communicate with mail servers from external services, like an email client on your phone. This library is called, predictably, smtplib and comes included with Python. This may not come as a surprise, but of course Python already has a library that lets you connect to an SMTP server, like the one Gmail uses. I thought it would be helpful to write up a tutorial on how to send emails with Gmail as the provider using Python.
While the subject of using Python to send emails may seem like it's been done to death, there are just so many different ways to do it and so many issues that can come up.
There are quite a few ways to send email with Python, whether it be through a 3rd party library like with boto and SES, or through an email protocol like SMTP.