How can I send the HTML content in an email using Python? I can send simple text.
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
Actually, yagmail took a bit different approach.
It will by default send HTML, with automatic fallback for incapable email-readers. It is not the 17th century anymore.
Of course, it can be overridden, but here goes:
For installation instructions and many more great features, have a look at the github.
Simplest solution for sending email from Organizational account in Office 365:
You might try using my mailer module.
Here is my answer for AWS using boto3
Here is a simple way to send an HTML email, just by specifying the Content-Type header as 'text/html':
Here's sample code. This is inspired from code found on the Python Cookbook site (can't find the exact link)