To add an embedded image to an HTML message

  • Thread starter Thread starter Mirsten Choiple
  • Start date Start date
M

Mirsten Choiple

Hello,

I can't understand how to implement the following instruction in the line of
code shown.

If someone could please spell it out for me, I would be most grateful
indeed.

Here is the instruction:
To attach multiple embedded images to a message, set the value of the
&H3712001E field for each file to a unique string, which you will use in the
src parameter for the <img> tag for that image.

Here is the code:

Set oField = colFields.Add(&H3712001E, "myident")



Regards,

DL
 
Eric,

Yes the code works fine for sending one image.

What I don't understand is how to send more than one image in one e-mail.

DL
 
Withought trying this myself, it looks like you have to repeat this line for
every image, changing the file name appropriately:

Set l_Attach = colAttach.Add("c:\test\graphic.jpg")

Then repeat this section for every image, changing the "myident" value so
that it is unique for every image and changing the Item(x) ordinal to
reference the proper attachment:

Set oAttach = oAttachs.Item(1)
Set colFields = oAttach.Fields
Set oField = colFields.Add(CdoPR_ATTACH_MIME_TAG, "image/jpeg")
Set oField = colFields.Add(&H3712001E, "myident")
oMsg.Fields.Add "{0820060000000000C000000000000046}0x8514", 11, True

Then add multiple lines like below to the HTMLBody property for each image,
changing myident to the unique identifiers that you've used:

l_Msg.HTMLBody = "<IMG align=baseline border=0 hspace=0 src=cid:myident>"
 
Back
Top