Re: Sending a HTML email with INDY 10.2.3 for Delphi 2005 (where the bug)

Giganews Newsgroups
Subject: Re: Sending a HTML email with INDY 10.2.3 for Delphi 2005 (where the bug)
Posted by:  Khurram Zaveri (
Date: Mon, 8 Oct 2007


I get the same issue when sending using 10.2.3, there is a bug wherein =
only the Last line of the HMTL/TEXT part is sent. I have requested =
support in this regard either. Please check my post in the "Socket Error =
10053" thread..=20

Here is the snippet..=20

[This is from Indy version 10.2.3.
The formed message only picks up the LAST lines from the IdText objects=20
(HTML and Text)

When I send this, the email client displays the last line of the text=20
portion of the message and the subject]

I have attached the message dumps as well.=20

Khurram Zaveri

"Peter Ypenburg" <pet…> wrote in message =
> Hi There,
> I had an app that was sending HTML emails with embedded images and was =
> Indy 10.0.52 in Delphi 2005 and it all worked fine.
> I then upgrade to Indy 10.2.3 and now it seems like it is broken, the=20
> picture that is was an embedded image now becomes an attachment and =
the HTML=20
> does not show.
> My dilemma is that I am not sure if it is a bug in Indy or a bug in my =
> because I made changes to my code based on some of the client requests =
> now I can not get it to work.
> I had a link to a sample program sending HTML emails with Indy but I =
> that link. Here is a simplified version of my code can some tell me if =
> is a bug in my code?
> My HTML looks like this:
> <html> <head> <title>Happy Birthday</title> </head>
> <body > <table>
> <tr> <th> <H2>Dear EMPLOYEENAME</H2> </th> </tr>
> <tr> <td> <img src=3D"cid:image1"> </td> </tr>
> </table> </body> </html>
> My code looks like this:
>      HTML :=3D TStringList.Create;
>      =
>      IdMessage :=3D TIdMessage.Create(Self);
>      IdMessage.Subject :=3D 'Happy birthday';
>      IdMessage.Recipients.EMailAddresses :=3D =
>      IdMessage.FromList.EMailAddresses :=3D '…';
>      IdMessage.Body.Clear;
>      IdMessage.MessageParts.Clear;
>      with TIdText.Create(IdMessage.MessageParts, nil) do
>      begin
>        Body.Text :=3D StringReplace(HTML.Text, 'EMPLOYEENAME', =
> [rfReplaceAll]);
>        ContentType :=3D 'text/html';
>      end;
>      with TIdAttachment.Create(IdMessage.MessageParts) do begin
>        ContentType :=3D 'image/jpeg';
>        ContentLocation :=3D ExtractFilePath(Application.ExeName);
>        FileName :=3D 'HappyBday.jpg';
>        ContentID :=3D 'image1';
>      end;
>      IdMessage.ContentType :=3D 'multipart/relative; =
>      IdSMTP.Send(IdMessage);
> Any help is appreciated as my client needs me to give him working =
> Thank you.
> --=20
> Peter
> Never ever give up,
> Hold out your cup,
> You never know when,
> You will get your zen.


In response to

Sending a HTML email with INDY 10.2.3 for Delphi 2005 (where the bug) posted by Peter Ypenburg on Thu, 4 Oct 2007