Having embedded an image in a HTML email, Outlook still shows it as an attachment. How do I stop that?

Using Delphi7 studio enterprise I am using COM automation to send emails via Outlook. When I use SMTP it is fine, but the embedded images in Outlook also appear as attachments which is untidy.

I have viewed the accepted solution for Q_21929137 and tried it but cannot get the variants fields to work.
Happy to provide code snippets and HTML source of emails, but the attaching of the signature images is as follows:
          for j := 0 to sl1.Count - 1 do
            strSourceFileName := sl1[j];
            strDisplayName := ExtractFileName(sl1[j]);
            // OlAttachmentType can be one of these OlAttachmentType constants.
            //   olByReference   = 4
            //   olByValue       = 1
            //   olEmbeddeditem  = 5
            //   olOLE           = 6

            intAttachType := 1;            
            intPosition := 1;
            oMailItem.MailItem.Attachments.Add(strSourceFileName, intAttachType, intPosition, strDisplayName);
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Geert GOracle dbaCommented:
if these images are available on the internet/intranet
and clients have internet/intranet access

you could use the tag <img source=""/>

no included images

Eddie ShipmanAll-around developerCommented:
Well, The code below works for me and I have OL2007.
Although after the display, I get a dialog that says "Incorrect Function"

Give it a try and see what you think..

procedure TForm1.Button1Click(Sender: TObject);
  objApp, l_Msg, oAttachs: OLEVariant;
  objApp := CreateOLEObject('Outlook.Application');
  l_Msg := objApp.CreateItem(olMailItem);
  oAttachs := l_Msg.Attachments;
  oAttachs.Add('c:\\feed-icon_orange-24px.bmp', olByValue, 1, 'MyImage');
  l_Msg.HTMLBody := '<IMG align="baseline" border="0" hspace="0" src="cid:feed-icon_orange-24px.bmp">';

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
futurelinkswAuthor Commented:
No more answers forthcoming so accepting average solution.
Eddie ShipmanAll-around developerCommented:
Well, accepting ANY solution for an almost year old topic is the right thing.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.