Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Hint: You can adjust the default video playback speed in your account settings.
Hint: You can set the default subtitles language in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please see our video player troubleshooting guide to resolve the issue.

Sending HTML Emails With Python

Give Feedback

In this video, you’ll learn how to format your text to send valid HTML. Therefore, you’ll make use of the MIME standard, which you can access through Python’s email.mime module.

konk on May 24, 2019

This worked as expected sending the email to my gmail account. It however didn’t work (no email received) sending to my xfinity account. Previous steps had worked sending plain-text to xfinity on port 465, but not now.

Joe Tatusko RP Team on May 24, 2019

Hi konk,

Have you tried checking your spam folder on your xfinity account?

Take a look at your sent messages from the email account you’re using to send the email to confirm that everything is correct.

Let me know if that works!

konk on May 24, 2019

Thanks for response. No, spam folder is empty. Unused account so easy to see all emails in inbox/ spam/ eleswhere.

Pygator on Aug. 25, 2019

Will this process work for outlook emails and university emails? Happy Pythoning.

Joe Tatusko RP Team on Aug. 27, 2019

It can, but it depends on the university mail server. In the course example, your process looks like this:

user -> Python script -> mail server (gmail in this case)

The Microsoft Outlook desktop client replaces the Python script, but it still receives and sends mail by interacting with the mail server. If this mail server is your university email, you’ll need the host and port information of the server. There is also a chance that the server will block these connections due to different security protocols or general configurations.

You could always take a look at the university mail configuration details, and this might point you in the right direction. Let me know if that helps!

gracetan on April 23, 2020

Hi Joe, thank you for your tutorial. I actually got two same body msg at my emails, I don’t know why, I followed what you said. Hi, how are you doing? testing email. www.youtube.com Hi, how are you doing? testing email.

Become a Member to join the conversation.