HTML Format Email
We can add a bit of color to our email by using an HTML format email instead of plaintext email. HTML format email is everywhere. I am sure you have seen images in emails, or emails with a fancy layout. Those are HTML format emails. Theoretically, to send out HTML format email using the Mailgun
API, it could be as simple as passing in the HTML code as a parameter to the mailgun.send_email
method.
Please refer to the following sample code to send out an HTML format email using Mailgun. We can see that we are just adding the new html
parameter here:
mailgun.send_email(to=user.email, Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â subject=subject, Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â text=text, Â Â Â Â Â Â Â Â Â ...