How to get real content of a simple email message in TidPOP3 object of Delphi

LeTay
LeTay used Ask the Experts™
on
I read a POP3 message in a TIdMessage component says M (idPOP3.Retrieve(MessageNumber,M))
But the Body has only one line, "This is a multipart message in MIME format.
The message content is (seen with gmail client) just a couple of simple text lines ...
So where are these text lines ?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Software architect
Top Expert 2012
Commented:
what you get if you iterate through all msg parts?
MsgItem := TIdMessage.Create;
    try
      IdPOP31.Retrieve(1, MsgItem);
      Memo1.Lines.Add('Message id: ' + MsgItem.MsgId);
      Memo1.Lines.Add('Message parts: ' + IntToStr(MsgItem.MessageParts.Count));
      for msgParts := 0 to MsgItem.MessageParts.Count-1 do
        if MsgItem.MessageParts[msgParts] is TIdText then
          Memo1.Lines.AddStrings((MsgItem.MessageParts[msgParts] as TIdText).Body);
    finally
      MsgItem.Free;
    end;

Open in new window

Author

Commented:
Will try that tomorrow, thanks

Author

Commented:
Excellent, I got the message and a trailer with some tags that I do not need
But the body is Ok
Thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial