Re: TIdEMailAddressItem in BCB 6

Giganews Newsgroups
Subject: Re: TIdEMailAddressItem in BCB 6
Posted by:  Remy Lebeau (TeamB) (
Date: Wed, 2 Jun 2004

"Indy @ AtoZed" <w…> wrote in message

> it turns out that the TidMessage datamembers From and
> Recipients ( TIdEMailAddresItem) are just pointers without
> the class being instantiated in either case.

Not true.  They are automatically instantiated in TIdMessage's constructor.

Also, the Recipients is a TIdEmailAddressList, not a TIdEmailAddressItem.
Perhaps you are looking at ReceiptRecipient instead?

> When I go to instantiate TIdEMailAddresItem myself, I find that
> I need to give the constructor another class, TCollection, as a
> parameter.

That is because TIdEMailAddresItem is derived from TCollectionItem.

> The trouble is you do not call TCollection directly it is only a base
> and I need to use a decendent class.  Which decendant class?

Use a NULL pointer, and then free the object when you are done with it.

> There has to be an easier way.

There is - just use the From and Recipients pointers as-is.  They are
already instantiated for you.



In response to

TIdEMailAddressItem in BCB 6 posted by Indy @ AtoZed on Wed, 2 Jun 2004