Skip to content

Commit

Permalink
fix 附件名乱码
Browse files Browse the repository at this point in the history
  • Loading branch information
ftlynx committed Nov 2, 2020
1 parent e2c5f63 commit 524b0f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func (m *connMail) Send(to string, cc string, subject string, plain_body string,
name := names[len(names)-1]
//处理附件文件名乱码
fileHeader := map[string][]string{
"Content-Type": {fmt.Sprintf(`text/plain; name="%s"`, mime.QEncoding.Encode("UTF-8", name))},
"Content-Type": {fmt.Sprintf(`text/plain; name="%s"`, mime.BEncoding.Encode("UTF-8", name))},
//"Content-Disposition": {fmt.Sprintf(`attachment; filename="%s"`, mime.QEncoding.Encode("UTF-8", name))},
}
msg.Attach(attach_file, gomail.Rename(name), gomail.SetHeader(fileHeader))
Expand Down

0 comments on commit 524b0f8

Please sign in to comment.