Class TMimeMess

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TMimeMess = class(TObject)

Description

Object for handling of e-mail message.

Hierarchy

Overview

Methods

Public constructor Create;
Public constructor CreateAltHeaders(HeadClass: TMessHeaderClass);
Public destructor Destroy; override;
Public procedure Clear; virtual;
Public function AddPart(const PartParent: TMimePart): TMimePart;
Public function AddPartMultipart(const MultipartType: String; const PartParent: TMimePart): TMimePart;
Public function AddPartText(const Value: TStrings; const PartParent: TMimePart): TMimepart;
Public function AddPartTextEx(const Value: TStrings; const PartParent: TMimePart; PartCharset: TMimeChar; Raw: Boolean; PartEncoding: TMimeEncoding): TMimepart;
Public function AddPartHTML(const Value: TStrings; const PartParent: TMimePart): TMimepart;
Public function AddPartTextFromFile(const FileName: String; const PartParent: TMimePart): TMimepart;
Public function AddPartHTMLFromFile(const FileName: String; const PartParent: TMimePart): TMimepart;
Public function AddPartBinary(const Stream: TStream; const FileName: string; const PartParent: TMimePart): TMimepart;
Public function AddPartBinaryFromFile(const FileName: string; const PartParent: TMimePart): TMimepart;
Public function AddPartHTMLBinary(const Stream: TStream; const FileName, Cid: string; const PartParent: TMimePart): TMimepart;
Public function AddPartHTMLBinaryFromFile(const FileName, Cid: string; const PartParent: TMimePart): TMimepart;
Public function AddPartMess(const Value: TStrings; const PartParent: TMimePart): TMimepart;
Public function AddPartMessFromFile(const FileName: string; const PartParent: TMimePart): TMimepart;
Public procedure EncodeMessage;
Public procedure DecodeMessage;
Public procedure DecodeMessageBinary(AHeader:TStrings; AData:TMemoryStream);

Properties

Published property MessagePart: TMimePart read FMessagePart;
Published property Lines: TStringList read FLines;
Published property Header: TMessHeader read FHeader;

Description

Methods

Public constructor Create;
 
Public constructor CreateAltHeaders(HeadClass: TMessHeaderClass);

create this object and assign your own descendant of TMessHeader object to Header property. So, you can create your own message headers parser and use it by this object.

Public destructor Destroy; override;
 
Public procedure Clear; virtual;

Reset component to default state.

Public function AddPart(const PartParent: TMimePart): TMimePart;

Add MIME part as subpart of PartParent. If you need set root MIME part, then set as PartParent Nil value. If you need set more then one subpart, you must have PartParent of multipart type!

Public function AddPartMultipart(const MultipartType: String; const PartParent: TMimePart): TMimePart;

Add MIME part as subpart of PartParent. If you need set root MIME part, then set as PartParent Nil value. If you need set more then 1 subpart, you must have PartParent of multipart type!

This part is marked as multipart with secondary MIME type specified by MultipartType parameter. (typical value is 'mixed')

This part can be used as PartParent for another parts (include next multipart). If you need only one part, then you not need Multipart part.

Public function AddPartText(const Value: TStrings; const PartParent: TMimePart): TMimepart;

Add MIME part as subpart of PartParent. If you need set root MIME part, then set as PartParent Nil value. If you need set more then 1 subpart, you must have PartParent of multipart type!

After creation of part set type to text part and set all necessary properties. Content of part is readed from value stringlist.

Public function AddPartTextEx(const Value: TStrings; const PartParent: TMimePart; PartCharset: TMimeChar; Raw: Boolean; PartEncoding: TMimeEncoding): TMimepart;

Add MIME part as subpart of PartParent. If you need set root MIME part, then set as PartParent Nil value. If you need set more then 1 subpart, you must have PartParent of multipart type!

After creation of part set type to text part and set all necessary properties. Content of part is readed from value stringlist. You can select your charset and your encoding type. If Raw is True, then it not doing charset conversion!

Public function AddPartHTML(const Value: TStrings; const PartParent: TMimePart): TMimepart;

Add MIME part as subpart of PartParent. If you need set root MIME part, then set as PartParent Nil value. If you need set more then 1 subpart, you must have PartParent of multipart type!

After creation of part set type to text part to HTML type and set all necessary properties. Content of HTML part is readed from Value stringlist.

Public function AddPartTextFromFile(const FileName: String; const PartParent: TMimePart): TMimepart;

Same as AddPartText, but content is readed from file

Public function AddPartHTMLFromFile(const FileName: String; const PartParent: TMimePart): TMimepart;

Same as AddPartHTML, but content is readed from file

Public function AddPartBinary(const Stream: TStream; const FileName: string; const PartParent: TMimePart): TMimepart;

Add MIME part as subpart of PartParent. If you need set root MIME part, then set as PartParent Nil value. If you need set more then 1 subpart, you must have PartParent of multipart type!

After creation of part set type to binary and set all necessary properties. MIME primary and secondary types defined automaticly by filename extension. Content of binary part is readed from Stream. This binary part is encoded as file attachment.

Public function AddPartBinaryFromFile(const FileName: string; const PartParent: TMimePart): TMimepart;

Same as AddPartBinary, but content is readed from file

Public function AddPartHTMLBinary(const Stream: TStream; const FileName, Cid: string; const PartParent: TMimePart): TMimepart;

Add MIME part as subpart of PartParent. If you need set root MIME part, then set as PartParent Nil value. If you need set more then 1 subpart, you must have PartParent of multipart type!

After creation of part set type to binary and set all necessary properties. MIME primary and secondary types defined automaticly by filename extension. Content of binary part is readed from Stream.

This binary part is encoded as inline data with given Conten ID (cid). Content ID can be used as reference ID in HTML source in HTML part.

Public function AddPartHTMLBinaryFromFile(const FileName, Cid: string; const PartParent: TMimePart): TMimepart;

Same as AddPartHTMLBinary, but content is readed from file

Public function AddPartMess(const Value: TStrings; const PartParent: TMimePart): TMimepart;

Add MIME part as subpart of PartParent. If you need set root MIME part, then set as PartParent Nil value. If you need set more then 1 subpart, you must have PartParent of multipart type!

After creation of part set type to message and set all necessary properties. MIME primary and secondary types are setted to 'message/rfc822'. Content of raw RFC-822 message is readed from Stream.

Public function AddPartMessFromFile(const FileName: string; const PartParent: TMimePart): TMimepart;

Same as AddPartMess, but content is readed from file

Public procedure EncodeMessage;

Compose message from MessagePart to Lines. Headers from Header object is added also.

Public procedure DecodeMessage;

Decode message from Lines to MessagePart. Massage headers are parsed into Header object.

Public procedure DecodeMessageBinary(AHeader:TStrings; AData:TMemoryStream);

HTTP message is received by THTTPSend component in two parts: headers are stored in THTTPSend.Headers and a body in memory stream THTTPSend.Document.

On the top of it, HTTP connections are always 8-bit, hence data are transferred in native format i.e. no transfer encoding is applied.

This method operates the similiar way and produces the same result as DecodeMessage.

Properties

Published property MessagePart: TMimePart read FMessagePart;

TMimePart object with decoded MIME message. This object can handle any number of nested TMimePart objects itself. It is used for handle any tree of MIME subparts.

Published property Lines: TStringList read FLines;

Raw MIME encoded message.

Published property Header: TMessHeader read FHeader;

Object for e-mail header fields. This object is created automaticly. Do not free this object!


Generated by PasDoc 0.9.0 on 2012-04-23 21:38:51