go-email icon indicating copy to clipboard operation
go-email copied to clipboard

The name of the email attachment is Chinese, and the expected result is inconsistent

Open huizhang001 opened this issue 2 years ago • 2 comments

file, _ := os.Open("./test.txt") part, err := email.NewPartAttachment(file, "测试") file.Close()

please help me !!!!!!!!!!!!!!!!!!!

huizhang001 avatar Mar 10 '22 08:03 huizhang001

image

huizhang001 avatar Mar 10 '22 08:03 huizhang001

Solved:

file, _ := os.Open("./test.txt") part, err := email.NewPartAttachment(file, mime.QEncoding.Encode("UTF-8", "测试")) file.Close()

huizhang001 avatar Mar 10 '22 08:03 huizhang001