genkgo / mail

Library to send e-mails over different transports and protocols (like SMTP and IMAP) using immutable messages and streams. Also includes SMTP server.
https://mail.readthedocs.io/
Other
402 stars 21 forks source link

Currently charset = us-ascii, how to set another one? #55

Closed k00ni closed 5 years ago

k00ni commented 5 years ago

Hi, when checking the generated mail message manually, i discovered you using us-ascii as character set.

Example:

Subject: subject
From: sender name <sender@mail.de>
Reply-To: reply@to.de
To: receiver@1.de
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary=GenkgoMailV2Part792e4450d62c

This is a multipart message in MIME format.

--GenkgoMailV2Part792e4450d62c
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

plain text

--GenkgoMailV2Part792e4450d62c
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

html text
--GenkgoMailV2Part792e4450

I was wondering how to change that? Also, could i run into UTF-8 related problems with that?

frederikbosch commented 5 years ago

The system detects automatically which charset is required. Since, you are not using any multi-byte characters in your message, the charset is us-ascii and the encoding is 7bit. The following test shows that the transfer encoding changes once you start using different characters.

k00ni commented 5 years ago

Ok, thanks.