Skip to content

Commit

Permalink
#44 Add Content-ID for Inlined Attachments (#45)
Browse files Browse the repository at this point in the history
Co-authored-by: msokolovsky <[email protected]>
  • Loading branch information
soky314 and msokolovsky authored Aug 14, 2020
1 parent a05347a commit 0e8cf84
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion attachments.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,17 @@ func getMIMEHeader(a attachment, ctype string) textproto.MIMEHeader {
var disp string
var header textproto.MIMEHeader

cid := fmt.Sprintf("<%s>", a.filename)
if a.inline {
disp = fmt.Sprintf("inline;\n\tfilename=%q", a.filename)
header = textproto.MIMEHeader{
"Content-Type": {ctype},
"Content-Disposition": {disp},
"Content-Transfer-Encoding": {"base64"},
"Content-ID": {cid},
}
} else {
disp = fmt.Sprintf("attachment;\n\tfilename=%q", a.filename)
cid := fmt.Sprintf("<%s>", a.filename)
header = textproto.MIMEHeader{
"Content-Type": {ctype},
"Content-Disposition": {disp},
Expand Down

0 comments on commit 0e8cf84

Please sign in to comment.