Python: What is the correct MIME type for attaching html file to email
I would encourage you to use a library rather than deal with the -rather unpythonic- built-in mail modules, such as the highly recommended envelopes: https://tomekwojcik.github.io/envelopes/index.html install with: Python code: