Little confuse about msg's encoder #162
-
I had notice that, every header (like subject) set in msg, will be encoded by msg.encoder, I want to know why do this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Beta Was this translation helpful? Give feedback.
-
That's basically how email works. Email only supports 7bit US-ASCII (with some exceptions in which mail servers support 8bit too). If you only use US-ASCII for your subjects and stuff, there is no need to encode it, but since go-mail supports full UTF-8, we need to encode the headers accordingly so that mail servers and clients can transfer and understand the content. |
Beta Was this translation helpful? Give feedback.
That's basically how email works. Email only supports 7bit US-ASCII (with some exceptions in which mail servers support 8bit too). If you only use US-ASCII for your subjects and stuff, there is no need to encode it, but since go-mail supports full UTF-8, we need to encode the headers accordingly so that mail servers and clients can transfer and understand the content.