veqryn / go-email

Email parsing and mail creation library for golang
MIT License
95 stars 32 forks source link

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

Open huizhang001 opened 2 years ago

huizhang001 commented 2 years ago

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

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

huizhang001 commented 2 years ago

image

huizhang001 commented 2 years ago

Solved:

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