V
V
Vadim Rublev2021-11-07 00:47:09
go
Vadim Rublev, 2021-11-07 00:47:09

Why krakozyabry in the subject line in "Opera Mail"?

I wash the letter:

var msg = []byte("To: " + myMail + "\r\n" +
  "Subject: " + "Тема письма" + "\r\n" +
  "Это содержимое письма.")
var err = smtp.SendMail(HostPortSMTP, auth, MailFrom, []string{myMail}, msg)

As I understand it, it leaves in UTF-8 encoding ... And on the web page - on the mail server - everything looks fine, but in the mail client "Opera Mail" in the Subject [instead of Cyrillic] krakozyabry.
How to decide? How is it generally done? Maybe the encoding required for the client is somehow requested?
After all, incoming letters in this client are displayed normally.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
galaxy, 2021-11-07
@galaxy

Headers with non-ASCII characters must be encoded according to the standard ( 1 , 2 ). I doubt go will do it for you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question