Re: Extract the actual body text and attachment from multipart mail

Giganews Newsgroups
Subject: Re: Extract the actual body text and attachment from multipart mail
Posted by:  Remy Lebeau (TeamB) (no.spam@no.spam.com)
Date: Thu, 5 Jan 2006

"Codeman II" <thegentlem…@webmail.co.za> wrote in message
news:3B348EDD56E8E240thegentlem…@webmail.co.za...

> What I am struggling with is the extract the actual body text
> (as it would display in a mail client) and the file attachment
> IF AN ATTACHMENT exists.  And also if more that one
> attachment I need to obtain all the attachments.

What exactly are you struggling with?  You did not provide any details about
the problems you are having.

Did you look at the TIdMessage.MessageParts collection yet?  That is where
attachments and MIME-encoded data is stored.

> I am using TidSMTPServer component and my code is
> in the OnReceiveMessageParsed event.

The problem with the scenerio you describe is that Indy 9's message parsing
capabilities are becoming very limited against today's increasingly complex
message formats.  More times then not, you have to do a bit of manual
parsing, as Indy 9 can only do so much.  You would be better off upgrading
to Indy 10, which has vastly better parsers for today's message formats.

Gambit

Replies

In response to

Extract the actual body text and attachment from multipart mail posted by Codeman II on Fri, 6 Jan 2006