Re: Decoding of EmailMessage text

2021-08-24 Thread Loris Bennett
jak writes: > Il 23/08/2021 13:12, Loris Bennett ha scritto: >> Jon Ribbens writes: >> >>> On 2021-08-23, Loris Bennett wrote: If instead of mail.set_content(body) I do mail.set_content(body, cte="quoted-printable") >>> >>> Try print(mail.get_content())

Re: Decoding of EmailMessage text

2021-08-23 Thread jak
Il 23/08/2021 13:12, Loris Bennett ha scritto: Jon Ribbens writes: On 2021-08-23, Loris Bennett wrote: If instead of mail.set_content(body) I do mail.set_content(body, cte="quoted-printable") Try print(mail.get_content()) rather than print(mail.as_string()) That did the trick -

Re: Decoding of EmailMessage text

2021-08-23 Thread Loris Bennett
Jon Ribbens writes: > On 2021-08-23, Loris Bennett wrote: >> If instead of >> >> mail.set_content(body) >> >> I do >> >> mail.set_content(body, cte="quoted-printable") > > Try print(mail.get_content()) rather than print(mail.as_string()) That did the trick - thanks! Cheers, Loris --

Re: Decoding of EmailMessage text

2021-08-23 Thread Loris Bennett
Bötland > > which is how the text appears in the mail. > > The 'ö' in 'Bötland' triggers the encoding - with 'Botland' the text > printed to the terminal is the same way as that in the mail. > > How do I decode the message properly for an terminal which uss UTF-8? If I do From: &q

Re: Decoding of EmailMessage text

2021-08-23 Thread Jon Ribbens via Python-list
On 2021-08-23, Loris Bennett wrote: > If instead of > > mail.set_content(body) > > I do > > mail.set_content(body, cte="quoted-printable") Try print(mail.get_content()) rather than print(mail.as_string()) -- https://mail.python.org/mailman/listinfo/python-list

Decoding of EmailMessage text

2021-08-23 Thread Loris Bennett
Hi, I have written a command-line program to send email using from email.message import EmailMessage which has an option '--verbose' which prints the email via if args.verbose: print(f"{mail.as_string()}") If I run this with $ poetry run send_email loris -l en -s "Another