TMimeDecode Last Updated: 09/27/2001 |
TMimeDecode take a file or a stream as input and produce several event when the message is parsed. each event can be used to display or to save to a file the message parts.
TMimeDecode decodes encoded parts using 'base64' and 'quoted-printable' methods. For those parts, the OnPartLine event will gives DECODED data. Other methods are passed not decoded. You can use the property ContentTransferEncoding to know which encoding method is used and add your own decoding mechanism.
Here are the sections available for the TMimeDecode:
- [ Properties ]
- [ Events ]
- [ Methods ]
- [ Hints ]
Below is the full description for all the sections in the TMimeDecode:
Below is a list of all Properties for use as a quick reference:
Below is a list of all Properties with their complete descriptions:
ApplicationType: | When PartContentType is 'application/something', ApplicationType contains the 'something'. |
[Return to Top] | |
Charset: | |
[Return to Top] | |
ContentType: | 'multipart/mixed' or empty. |
[Return to Top] | |
CurrentData: | For each OnHeaderLine, OnPartHeaderLine and OnPartLine, you can find the actual data at the address pointed by the property CurrentData (a PChar). The reason for a PChar is that the data can be quite large. The data pointed is a null terminated string. You can get the length using StrLen, or convert to a string with StrPas. It is more efficient to process the data using a pointer. Using strings tends to copy the data several times. The OnPartLine event passes a PChar and a length to the handler. This actually point to the internal buffer and overwrite the original data (base64 and quote-printable method produce decoded data smaller than encoded one). |
[Return to Top] | |
Date: | The message date. Looks like: Mon, 16 Feb 1998 12:45:11 -0800 |
[Return to Top] | |
Dest: | The message destination (To field, but To is a reserved word) . Looks like "Francois Piette" <francois.piette@pophost.eunet.be> |
[Return to Top] | |
DestStream: | Specifies the stream where the decoded lines will be written. Use this to decode attached file to streams, but remember to change it for every part, and check if the current part is a file or not. |
[Return to Top] | |
Encoding: | Can be base64 , quoted-printable or x-uuencode |
[Return to Top] | |
From: | The message author. Not necessary the real author... Looks like "Francois Piette" <francois.piette@pophost.eunet.be> |
[Return to Top] | |
MimeVersion: | Contains information about the Mime-Version extracted from the message header |
[Return to Top] | |
PartCharset: | This is a complement for the PartContentType. |
[Return to Top] | |
PartContentID: | This is also a complement for the PartContentType. |
[Return to Top] | |
PartContentType: | such as 'text/plain' or 'application/x-zip-compressed'. Is the description of what the part contains. |
[Return to Top] | |
PartDisposition: | Can be 'inline' or 'attachment' and is generally followed by a 'filename=something' |
[Return to Top] | |
PartEncoding: | Encoding method (Content-Transfer-Encoding). Can be used to decode unsupported methods (supported methods are 'base64' and 'quoted-printable'. '7bit' and '8bit' doesn't generally require processing. |
[Return to Top] | |
PartFileName: | The specified filename in Content-Disposition header line. Be aware that the file name is not necessary suitable for windows ! Use it with caution... |
[Return to Top] | |
PartName: | This is the value for 'name=something' in the Content-Type header line. |
[Return to Top] | |
PartNumber: | Starting from 0 for the non-significant part and starting from 1 for the first line of each part or header |
[Return to Top] | |
ReturnPath: | |
[Return to Top] | |
Subject: | The message subject |
[Return to Top] | |
Below is a list of all Events for use as a quick reference:
Below is a list of all Events with their complete descriptions:
OnInlineDecodeBegin: | Indicates when a UU encoded part is about to be decoded |
[Return to Top] | |
OnInlineDecodeEnd: | Indicates when a UU encoded part has been decoded |
[Return to Top] | |
OnPartLine: | Indicates when a line of the current part of the document has been decoded |
[Return to Top] | |
OnHeaderBegin: | Indicates when the header of the message is about to be decoded |
[Return to Top] | |
OnHeaderEnd: | Indicates when the header of the message has been decoded |
[Return to Top] | |
OnHeaderLine: | Indicates when a line of the header has been decoded |
[Return to Top] | |
OnInlineDecodeLine: | Indicates when a UU encoded part line has been decoded |
[Return to Top] | |
OnPartBegin: | Indicates when a new part of the file is about to be decoded |
[Return to Top] | |
OnPartHeaderEnd: | Indicates when the header of the current part has been decoded |
[Return to Top] | |
OnPartHeaderLine: | Indicates when line of the header of the current part has been decoded |
[Return to Top] | |
OnPartEnd: | Indicates when a new part of the file has been decoded |
[Return to Top] | |
OnPartHeaderBegin: | Indicates when the header of the current part is about to be decoded |
[Return to Top] | |
Below is a list of all Methods for use as a quick reference:
Below is a list of all Methods with their complete descriptions:
DecodeFile: | Use this method to decode a file stored in your computer. |
[Return to Top] | |
DecodeStream: | Use this method to decode a stream. |
[Return to Top] | |
Below is a list of all Hints for use as a quick reference:
Below is a list of all Hints with their complete descriptions:
First of all: | Take a good look at the MimeDemo example.... |
[Return to Top] | |