Topic Path: Symbol Reference > Classes > TIdMessageDecoderMIME Class > TIdMessageDecoderMIME Methods > ReadHeader Method
TIdMessageDecoderMIME.ReadHeader Method

Implements the method used to read an RFC message header from a MIME-encoded message part.

procedure ReadHeader; override;

ReadHeader is an overridden procedure in TIdMessageDecoderMIME that implements the method used to read an RFC 2822-compliant message header from a MIME-encoded message part. 

When BodyEncoded is True, ReadHeader examines the ContentType and ContentDisposition for the TIdMessage instance to determine the PartType and Filename for the message part. 

When BodyEncoded is False, ReadHeader calls ReadLn to retrieve lines from the message part until a blank line, that signals the end of message headers, is retrieved. Message headers are added to the Headers property, with folded header lines being added to the most recent message header. 

For message parts having a ContentType in the 'multipart/*' MIME type, the existing MIME boundary for the message is stored in the MIMEBoundary property. For other instances, the MIMEBoundary property is pushed on the boundary stack for the TIdMessage instance. 

When ReadHeader has retrieved all message header lines, the content-type and content-disposition headers are examined to determine if the message part contains an attachment. 

ReadHeader will update the message part type to ptText when an attachment is not found. When an attachment is indicated in the content-disposition message header, ReadHeader sets the message part type to ptAttachment and parses an optional filename into the Filename property.





Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.