# Class TMimeMess

Description | Hierarchy | Fields | Methods | Properties

## Unit

mimemess

## Declaration

`type TMimeMess = class(TObject)`

## Description

Object for handling of e-mail message.

## Hierarchy

TMimeMess > TObject

## Methods

### Overview

| `constructor Create;`
| `constructor CreateAltHeaders(HeadClass: TMessHeaderClass);`
| `destructor Destroy; override;`
| `function AddPart(const PartParent: TMimePart): TMimePart;`
| `function AddPartBinary(const Stream: TStream; const FileName: string; const PartParent: TMimePart): TMimepart;`
| `function AddPartBinaryFromFile(const FileName: string; const PartParent: TMimePart): TMimepart;`
| `function AddPartHTML(const Value: TStrings; const PartParent: TMimePart): TMimepart;`
| `function AddPartHTMLBinary(const Stream: TStream; const FileName, Cid: string; const PartParent: TMimePart): TMimepart;`
| `function AddPartHTMLBinaryFromFile(const FileName, Cid: string; const PartParent: TMimePart): TMimepart;`
| `function AddPartHTMLFromFile(const FileName: String; const PartParent: TMimePart): TMimepart;`
| `function AddPartMess(const Value: TStrings; const PartParent: TMimePart): TMimepart;`
| `function AddPartMessFromFile(const FileName: string; const PartParent: TMimePart): TMimepart;`
| `function AddPartMultipart(const MultipartType: String; const PartParent: TMimePart): TMimePart;`
| `function AddPartText(const Value: TStrings; const PartParent: TMimePart): TMimepart;`
| `function AddPartTextFromFile(const FileName: String; const PartParent: TMimePart): TMimepart;`
| `procedure Clear;`
| `procedure DecodeMessage;`
| `procedure EncodeMessage;`

### Description

| `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!

| `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.

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

Same as AddPartBinary, but content is readed from file

| `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.

| `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.

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

Same as AddPartHTMLBinary, but content is readed from file

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

Same as AddPartHTML, but content is readed from file

| `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.

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

Same as AddPartMess, but content is readed from file

| `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.

| `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.

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

Same as AddPartText, but content is readed from file

| `procedure Clear;`

Reset component to default state.

| `constructor Create;`

| `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.

| `procedure DecodeMessage;`

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

| `destructor Destroy; override;`

| `procedure EncodeMessage;`

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

## Properties

### Overview

| `property Header: TMessHeader;`
| `property Lines: TStringList;`
| `property MessagePart: TMimePart;`

### Description

| `property Header: TMessHeader;`

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

| `property Lines: TStringList;`

Raw MIME encoded message.

| `property MessagePart: TMimePart;`

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.

Generated by PasDoc 0.8.8.2 on 2005-01-19 20:01:18