mailsend
mailsend copied to clipboard
Feedback - using "content-id", "inline" and "attachment" dispositions for outlook
Howdy,
Thought this was important enough to pass along. I send .jpegs in my email using both "inline" and "attachment" dispositions, mime-type "image/jpeg". Five .jpegs are used for cosmetics in the html email for banners, icons, etc. These 5 also have a CID declared for use in the email body. The 6th .jpeg attachment is what I am wanting the user to receive and save. If I declare a CID for this 6th image, then outlook forces it into "inline" and bugs within outlook 2010 and prior, don't allow it to be copied and saved. So, by not giving it a CID and using the disposition "attachment", outlook keeps it as an attachment that can be saved, but I can't use it in the email body. Its a tradeoff..
Here's the code in VB -
cmdln = " -smtp " & Globals.tmpServerURL & _ " -domain " & Globals.tmpServerURL & _ " -port " & Globals.tmpServerPort & _ " -pass " & Globals.tmpPassword & _ " -f " & Globals.tmpAcctEmailAddr & _ " -t " & recip & _ " -sub """ & Globals.EmailToCaption(Globals.EmailFifoOut) & """" & _ " -auth-plain -v -log c:\onsite\software\email.log " & _ " -sub " & """" & Globals.EmailToCaption(Globals.EmailFifoOut) & """" cmdln = cmdln & " -disposition ""inline"" -mime-type ""image/jpeg"" " cmdln = cmdln & " -content-id ""img_01"" -attach c:\onsite\software\email_img01.jpg " cmdln = cmdln & " -content-id ""img_02"" -attach c:\onsite\software\email_img02.jpg " cmdln = cmdln & " -content-id ""img_03"" -attach c:\onsite\software\email_img03.jpg " cmdln = cmdln & " -content-id ""img_04"" -attach c:\onsite\software\email_img04.jpg " cmdln = cmdln & " -content-id ""img_05"" -attach c:\onsite\software\email_img05.jpg " cmdln = cmdln & " -disposition ""attachment"" -mime-type ""image/jpeg"" " cmdln = cmdln & " -content-id ""event_pic"" -attach """ & fname & """ -v -log " & "c:\onsite\software\email.log" cmdln = cmdln & " -attach """ & fname & """ -v -log " & "c:\onsite\software\email.log" cmdln = cmdln & " -attach c:\onsite\software\emailbody.html,text/html,i"
..Doug
Round two. Had to rewrite the code because attachments were being renamed as "untitled" and lost their file extension. I think the problem has to do from switching the disposition from inline to attachment. I was attaching the content first as inline, then the final image as attachment, so I juggled switches around and things worked. Dunno why.. Here's the list of switches I'm using now -
mailsend -smtp ??? -domain ??? -port ?? -user ??? -pass ??? -f ??? -t ??? -auth-plain -v -log ??? -sub "???" -attach c:\onsite\printed\00043_p1_m2_bk1_n001_f01_de.jpg,image/jpg,a -attach c:\onsite\software\emailbody.html,text/html,i -content-id "img_01" -attach c:\onsite\software\email_img01.jpg,image/jpg,i -content-id "img_02" -attach c:\onsite\software\email_img02.jpg,image/jpg,i -content-id "img_03" -attach c:\onsite\software\email_img03.jpg,image/jpg,i -content-id "img_04" -attach c:\onsite\software\email_img04.jpg,image/jpg,i -content-id "img_05" -attach c:\onsite\software\email_img05.jpg,image/jpg,i