Internet Direct (Indy) Version 9.0.2 Beta
TIdMessageEncoder.Encode
Constructs the encoded contents of an RFC-822 message part.

procedure Encode(const AFilename: string; ADest: TStream); overload;
procedure Encode(ASrc: TStream; ADest: TStream); virtual; abstract; overload;
Parameters
const AFilename: string
Stream used to retrieve the un-encoded contents of the message part.

ADest: TStream
Stream where the encoder message part will be written.

Description
Encode is an overloded procedure in TIdMessageEncoder that retrieves the un-encoded values of an RFC-822 message part, and constructs the encoded contents of the message part.

AFilename specifies the file name used to retrieve the un-encoded contents of the message part.

ASrc is a TStream descendant used to retrieve the un-encoded contents of the RFC message part.

ADest is a TStream descendant where the encoded message part will be written.

The file-based variant of Encode reads the contents of the file specified in AFilename, and writes the encoded contents to the stream specified in ADest. This variant of Encode creates a temporary file stream for AFilename, and calls the abstract Encode method using the temporary file stream.

The Stream-based variant of Encode is an abstract virtual procedure, and specifies the interface for using TStreams as bothe the source of the RFC message part and the destination for the Descendant classes, like TIdMessageEncoderMIME, TIdMessageEncoderUUE, and TIdMessageEncoderXXE, must implement the Encode method to provide support for genmerating the encoded message part contents using a specific encoding algorithm.