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 found an example (link) that works great, but I would need to set font's typeface of an email message as monospaced (e.g. 'Courier New').
Any idea how to do this?
Thanks in advance.
Open the Python shell. Then, in the menu bar, under "Python" (directly to the right of the Apple icon), you will find "Preferences". Under this, you will find the "Font/Tabs" option, and you can change the font size according to your preference.
To change the font style, you need the font-style property with a value of normal , oblique , or italic . Normal is the default font style, so you don't need to specify it unless you have to override it. As usual, you can change the font style in inline, internal, or external CSS.
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 <font face="Courier New, Courier, monospace"></font>
(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 = '<font face="Courier New, Courier, monospace">' + text + '</font>'
If you wanted that to be the whole email.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With