Re: MIME problem

Giganews Newsgroups
Subject: Re: MIME problem
Posted by:  Rhys Sage (abu…@127.0.0.1)
Date: Tue, 24 Feb 2004

My Latest code is the following. Nearly there, I feel, but I'm stuck with an
error identifying the type of message part. I'm trying to extract the text
from a MIME email.
IdMessage1.MessageParts.Items[Kownt] = TIdText then

--
Yours

Rhys

Join the anti-spam project:
http://groups.yahoo.com/group/Anti-Spam-Development/
or view my website:
http://www.sageworld.freeserve.co.uk

"Linux - an operating system that wants to work.
Windows - an operating system that mostly works.
Mac OS - an operating system that really works."

procedure TMailControl.DisplayEmail(Item : Integer);
var MessageNumber,Kownt : Integer;
MyString : String;
begin
  RichEdit1.Lines.Clear;
  RichEdit4.Lines.Clear;
// download indicated email
if Pos('::',ListBox1.Items.Strings[ListBox1.ItemIndex]) > 0 then
  begin
  MyString := ListBox1.Items.Strings[Item];
  MessageNumber := StrToInt(Copy(MyString,1,Pos('::',MyString)-1));
  IdMessage1.Clear;
  IdPOP31.RetrieveMsgSize(MessageNumber);
  IdPOP31.Retrieve(MessageNumber,IdMessage1);
  RichEdit1.Lines.AddStrings(IdMessage1.Headers);
  // now check to see if it's MIME
  if IdMessage1.MessageParts.Count = 0 then
    RichEdit4.Lines.AddStrings(IdMessage1.Body)
  else
    begin
    for Kownt := 0 to IdMessage1.MessageParts.Count -1 do
      begin
      IdMessage1.MessageParts.Items[Kownt] = TIdText then

RichEdit4.Lines.AddStrings(TIdText(IdMessage1.MessageParts.Items[Kownt]).Bod
y);
      End;
    end;
  end
else ShowMessage('Unable to display');
end;

Replies

In response to

MIME problem posted by Rhys Sage on Tue, 24 Feb 2004