« Return to the blog entry
Yes. For inline images you'll have to change a few things:
- Set the content-disposition to inline. Change:
Set Me.mh = Me.mc.CreateHeader("Content-Disposition")
Call Me.mh.SetHeaderVal( |attachment; filename="your_image.png"| )
to:
Call Me.mh.SetHeaderVal( |inline; filename="your_image.png"| )
- Add a Content-ID header for every inline image:
Set Me.mh = Me.mc.CreateHeader("Content-ID")
Call Me.mh.SetHeaderVal( |<your_image.png>| )
- Add a reference to the image in the HTML code:
<img src="cid:your_image.png">
I've noticed that (at least in Outlook) if you don't add the reference in the HTML the image is show as an attachment. If the reference is present the image is hidden from the list of attachments.
Yes. For inline images you'll have to change a few things:
- Set the content-disposition to inline. Change:
Set Me.mh = Me.mc.CreateHeader("Content-Disposition")
Call Me.mh.SetHeaderVal( |attachment; filename="your_image.png"| )
to:
Set Me.mh = Me.mc.CreateHeader("Content-Disposition")
Call Me.mh.SetHeaderVal( |inline; filename="your_image.png"| )
- Add a Content-ID header for every inline image:
Set Me.mh = Me.mc.CreateHeader("Content-ID")
Call Me.mh.SetHeaderVal( |<your_image.png>| )
- Add a reference to the image in the HTML code:
<img src="cid:your_image.png">
I've noticed that (at least in Outlook) if you don't add the reference in the HTML the image is show as an attachment. If the reference is present the image is hidden from the list of attachments.