Summary
In this chapter, we looked at how e-mails work at a very high level. We saw that SMTP is a text-based protocol and the SMTP servers listen on port 587 for the e-mail clients to access them. E-mails, if on the same server, are just copied to the destined user's inbox. If they are on a different server, a DNS lookup is performed to find out the IP of the SMTP server and the e-mail is handed over to that server.
Next, we saw how to send e-mails. We saw that send_email() is the function that we can use. We also saw that EmailMessage is a class whose instance can be created and used to send an e-mail. We learned that both the function and the EmailMessage class's constructor take the same keyword arguments. We also learned how to send attachments ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access