Sending messages in HTML format

The library provides you with an option to send a message in HTML format. In this way, while sending an email message, you can specify a MIME version, content type, and character set, thanks to the MiMEText constructor. In this example, we are using the 'html' content type and the 'utf-8' character set:

mail_message = """
<p>Python</p>
<p><a href="http://www.python.org">python</a></p>
"""
message = MIMEText(mail_message , 'html', 'utf-8')

In this way we can provide a message in HTML format following utf-8 encoding.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset