body html's image shown as attach in yahoo email

Giganews Newsgroups
Subject: body html's image shown as attach in yahoo email
Posted by:  Tarvirdi (mt…@koasr.net)
Date: Mon, 23 Jun 2003

I have created an email by TIdMessage as bellow that sends "main.htm" with a
image as "logo.gif".
But sent email's image (logo.gif) shown in yahoo as a attached file.
what should I correct?
Tarvirdi

    with IdMessage1 do  begin
      From.Text := 'BankKeshavarzi0160';
      Sender.Text := '';
      Recipients.EMailAddresses := 'mohtarvir…@yahoo.com';
      Subject := 'Account Transaction - 31803';
      ContentType := 'multipart/relative';
    end;

    // plain text body for the html impaired
    with TIdText.Create(IdMessage1.MessageParts) do
    begin
        ContentType := 'text/plain';
        Body.add('');
    end;

//html body with logo
    doc.LoadFromFile('main.htm');
    // html body with reference to inline image
    with TIdText.Create(IdMessage1.MessageParts) do
    begin
      ContentType := 'text/html';
      body.add(doc.Text);
    end;

    with TIdAttachment.Create(IdMessage1.MessageParts, 'logo.gif') do begin
      ContentType := 'image/gif';
      ContentDisposition := 'inline';
      ExtraHeaders.Values['content-id'] := 'Logo.gif';
    end;

Main.htm file contains

<HTML><HEAD>
<META http-equiv=Content-Language content=en-us>
<META content="Microsoft FrontPage 5.0" name=GENERATOR>
<META content=FrontPage.Editor.Document name=ProgId>
<META http-equiv=Content-Type content="text/html; charset=windows-1256">
</HEAD>
<BODY bgColor=#ffffff background=cid:BackGround.gif>
<P dir=rtl align=center><IMG alt="" hspace=0
src="cid:Logo.gif" align=baseline
border=0></P>
<P dir=rtl><span lang="fa"><font face="Tahoma" size="4">ÒÇÑÔ Úãá˜ÑÏ ÍÓÇÈ
ÔãÇ Èå
&#1740;æÓÊ ã&#1740;ÈÇÔÏ</font></span></P>
<P dir=ltr><FONT face=Tahoma size=4>Your account's transaction is
attached</FONT></P>
</BODY></HTML>

Replies