Problem with SMTPServer and HTML-Mails

Giganews Newsgroups
Subject: Problem with SMTPServer and HTML-Mails
Posted by:  Master Surfer (mastersurfer…@web.de)
Date: Fri, 05 Sep 2008

Hello,

I have a great problem!

I use the current Indy DevSnapshot. I have a IdSmtpServer in my project,
on message arrival i proccess it with this code:

<code>
if MsgObj.MessageParts.Count > 0 then begin
  for i := 0 to MsgObj.MessageParts.Count - 1 do begin
    if MsgObj.MessageParts.Items[i] is TidText then begin
      if (LowerCase(MsgObj.MessageParts.Items[i].ContentType) =
'text/plain') then begin
        //save the plaintext from:
        //TStrings(TidText(MsgObj.MessageParts.Items[i]).Body).GetText
      end else if (LowerCase(MsgObj.MessageParts.Items[i].ContentType)
= 'text/html') then begin
        //save the htmltext and convert it!
// ***********
// PROBLEM!!!!
// ***********
        //TStrings(TidText(MsgObj.MessageParts.Items[i]).Body).Text;
        end else if MsgObj.MessageParts.Items[i] is TIdAttachmentFile
then begin

// and so on....
</code>

if the html-text contains a CRLF + "." + CRLF the html content is cut at
this position, but the mail is accepted correctly.
this string is normally the signal for a mailserver that the transfer is
completed by the client.

for example the mail-stream looks like that:
<snippt>
freien Internetzugang </u>durch fremde Personen in Ihren Einrichtungen (z.B=
..
Schulen, Kinderg=C3=A4rten und andere kommunale Einrichtungen). Sie als Bet=
</snippt>

after the "z.B" I don't get more html-source with the code.

So what is the problem in my code or is it a bug? What can I do?

Thanks for a answer.

Greets

Replies