Python - how to change email text typeface

后端 未结 2 1239
南旧
南旧 2020-12-20 18:30

I\'m writing an app that generates full report and it\'s summary, and sends them via email. A summary is sent as text in email, and a full report is sent as attachement. I f

2条回答
  •  时光取名叫无心
    2020-12-20 18:54

    Email will send as both plaintext and as HTML. A plaintext email renderer will generally be rendered in a monospace font, but there is no guarantee of that. More importantly, there is nothing you can do to change what font the plaintext will display in.

    If your recipient is reading mail in an HTML capable email client, you should be able to accomplish that by wrapping (a font tag) around the pieces of the email you'd like to have in Courier. In the method provided, you would simply have:

    text = '' + text + ''
    

    If you wanted that to be the whole email.

提交回复
热议问题