Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 May : bug in indy?: recipients retrieving incomplete html textpart, please help

www.cryer.info
Managed Newsgroup Archive

bug in indy?: recipients retrieving incomplete html textpart, please help

Subject:bug in indy?: recipients retrieving incomplete html textpart, please help
Posted by:"Leander" (l.v.e..@obec.nl)
Date:Thu, 31 May 2007 11:53:43

I have a problem sending email in indy version 10.1.5

I'm using the following code for sending messages that include both html and
plain text.

lvMessage := TIdMessage.Create;
lvIdSmtp := TidSmtp.Create;

Code:
***********************************
//create parent text part.
with Tidtext.Create(lvMessage.MessageParts)
do ContentType := 'multipart/alternative';
lvParentIndex := lvMessage.MessageParts.Count - 1;

//create plain text part.
with TIdtext.Create(lvMessage.MessageParts, FStructure.Body) do
begin
  ContentType := 'text/plain';
   if lvParentIndex <> - 1
   then ParentPart := lvParentIndex;
end;

//create html text part.
with TIdtext.Create(lvMessage.MessageParts, FStructure.HtmlBody) do
begin
  ContentType := 'text/html';
   if lvParentIndex <> - 1
   then ParentPart := lvParentIndex;
end;

//send the email
   lvIdSmtp.Connect;
   trya
     lvIdSmtp.Send(lvMessage);
   finally
      if lvIdSmtp.Connected
      then lvIdSmtp.Disconnect;
   end;

*************************************

This works perfecly for most emails, however on occasion the recepient only
retreives part of the html message. E.g. only the html close tags.

I can not reproduce this problem so i have no idea what is going wrong.

I noticed the content-transfer-encoding by Indy is set to quoted-printable
for the text parts. Could it be that my problems are solved when overriding
this with base64 encoding?

Thanks in advance,

Leander

Replies:

www.cryer.info
Managed Newsgroup Archive