Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Mar : Re: Email Attachments

www.cryer.info
Managed Newsgroup Archive

Re: Email Attachments

Subject:Re: Email Attachments
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Tue, 21 Mar 2006 12:29:12

"Anthoni Gardner" <nonononon@nononon.com> wrote in message
news:442052ec@newsgroups.borland.com...

> So if I loop through that collection and find any TIDAttachment
> instances, then its 100% guarenteed there is an attachment to it,
> and therefore I can safely discard it ?

Discard the entire message, yes.  It may not be safe to discard just the
attachment, if other message parts have references to that attachment.

> I just want to read the normal text version of the email (idMessage.Body)
> and not anything with attachments.

If the MessageParts collection has items in it, then you will not be able to
get the text from the TIdMessage.Body property, because that is not where
the text is stored.  It will be stored as TIdText instances in the
MessageParts collection instead.  Also, you have to take into account that
there may be multiple TIdText items if the email contain multiple flavors of
the text (plain, html, rtf, etc), so make sure you are paying attention to
the ContentType of each item, and that you pay attention to the nesting
levels when "multipart/" items are present.


Gambit

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive