problem with body in outlook

Giganews Newsgroups
Subject: problem with body in outlook
Posted by:  Tomas (tom…@gmail.com)
Date: Wed, 23 Apr 2008

Hello,

I use code below to create html e-mail with attachment. Everyhting works
fine on most of e-meilers, but
on Outlook Express I get two attachments and no html body. I see body html
as attachment and it is not displayed in outlook viewer.

Maybe someone could help me?

Regards,
Tomas

        IdMsg.IsEncoded := True;
        IdMsg.CharSet := 'iso-8859-1';
        IdMsg.Encoding := meMIME;
        IdMsg.Recipients.EMailAddresses := ToAddress.Text;
        IdMsg.BccList.EMailAddresses := BCC.Text;
        IdMsg.Subject := Subject;
        IdMsg.From.Address := FromAddress;
        IdMsg.From.Name := FromName;
        IdMsg.ReplyTo.EMailAddresses := ReplyTo;
        IdMsg.ContentType := 'multipart/*';

        Body:='my <b>body</b>';

        with TIdText.Create(IdMsg.MessageParts, Body) do
        begin
            ContentType := 'text/html';
        end;

        FFileName:='c:\1.pdf'

          with TIdAttachmentFile.Create(IdMsg.MessageParts, FFileName) do
          begin
            ContentType := GetMimeTypeFromFile(FFileName);
            FileName := ExtractFileName(FFileName);
          end;

Replies