Indy 9
TIdMessageParts
Hierarchy, Properties, Methods, See Also, Unit: IdMessage
Collection for individual message parts in the message.
TIdMessageParts = class(TOwnedCollection)
Unit
IdMessage
Description
TIdMessageParts is a collection which contains the individual message parts for a MIME message, and contains ancestors of TIdMessagePart such as TIdText and TIdAttachment.

TIdMessageParts.AttachmentCount
TIdMessageParts, See Also
Indicates the number of attachments in the message part collection.
property AttachmentCount: integer;
Description
AttachmentCount is a read-only Integer property that identifies the number of attachments in the message parts collection. AttachmentCount is updated in TIdMessage.GenerateHeader, and indicates the number of TIdAttachment items that do not contain a Content-Id header in the ExtraHeaders property. Attachments with a Content-Id are included in RelatedPartCount.

Note: AttachmentCount, RelatedPartCount, and TextPartCount are be used when headers are generated for an outgoing mail message. You should be able to update the values prior to transmission (or on receipt) by calling CountParts.


TIdMessageParts.AttachmentEncoding
TIdMessageParts, See Also
Identifies the default encoding mechanism used for a message part.
property AttachmentEncoding: string;
Description
AttachmentEncoding is a String property that identifies the encoding mechanism used for attachment message parts in the message. Changing the value of AttachmentEncoding for the message part collection also updates the default encoding used for all message parts in the collection, and updates MessageEncoderInfo to the encoder that handles the AttachmentEncoding .

Default value for AttachmentEncoding is 'MIME', as assigned in the Create constructor.


TIdMessageParts.Items
TIdMessageParts
Represents the message parts in the collection.
property Items [Index: Integer]: TIdMessagePart;
Parameters
Index
Position of the message part in the collection.
Return Value
TIdMessagePart - Collection item at the specified position.
Description
Items is an indexed TIdMessagePart property used to access the individual message parts in the collection. Index values must be in the range 0..Count-1.

TIdMessageParts.MessageEncoderInfo
TIdMessageParts
Represents encoder information for the message parts collection.
property MessageEncoderInfo: TObject;
Description
MessageEncoderInfo is a TObject property that represents encoder information for the message parts collection. MessageEncoderInfo is updated to reflect the coder need to represent the AttachmentEncoding. MessageEncoderInfo is used in TIdMessage.GenerateHeader to initalize headers for a message based on the encoding schema. MessageEncoderInfo is also used in TIdAttachment.Encode to instantiate an encoder for writing an attachment to a stream.

TIdMessageParts.RelatedPartCount
TIdMessageParts, See Also
Indicates the number of attachments in the message part collection.
property RelatedPartCount: integer;
Description
RelatedPartCount is a read-only Integer property that identifies the number of dependent attachments in the message parts collection. RelatedPartCount is updated in TIdMessage.GenerateHeader, and indicates the number of TIdAttachment items that contain a Content-Id header in the ExtraHeaders property. Attachments without a Content-Id are included in AttachmentCount.

Note: AttachmentCount, RelatedPartCount, and TextPartCount are be used when headers are generated for an outgoing mail message. You should be able to update the values prior to transmission (or on receipt) by calling CountParts.


TIdMessageParts.TextPartCount
TIdMessageParts, See Also
Indicates the number of text message parts in the collection.
property TextPartCount: integer;
Description
TextPartCount is a read-only Integer property that identifies the number of text parts in the message parts collection. TextPartCount is updated in CountParts, and indicates the number of TIdText items in Items.

Note: AttachmentCount, RelatedPartCount, and TextPartCount are be used when headers are generated for an outgoing mail message. You should be able to update the values prior to transmission (or on receipt) by calling CountParts.


TIdMessageParts.Add
TIdMessageParts
Adds a message part to the collection.
function Add: TIdMessagePart;
Return Value
TIdMessagePart - Message part added to the collection.
Description
Add is a TIdMessagePart function that is disabled for the collection. Add always returns Nil as the return value. Add is disabled to prevent adding the ancestor class TIdMessagePart to the collection. Use TIdText.Create and TIdAttachment.Create to add the new collection item to the collection identified by the Collection parameter.

TIdMessageParts.CountParts
TIdMessageParts, See Also
Determines the number of specific message parts in the collection.
procedure CountParts;
Description
CountParts is procedure that Determines the number of specific message parts in the collection, and updates the TextPartCount, AttachmentCount, and RelatedPartCount properties to indicate the calculated values.

CountParts is used during generation of headers for a mail message proper to transmission.


TIdMessageParts.Create
TIdMessageParts, See Also
Constructor for the object instance.
constructor Create(AOwner: TPersistent); reintroduce;
Parameters
AOwner: TPersistent
Owner of object instance.
Description
Create is the constructor for the object instance. Create calls the inherited Create method using AOwner and TIdMessagePart as the owner and class instance for the collection.

Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.