Mail Message (MIME)


Class aprMIME

 

Description

The aprMIME Class enables the developer to easily manage mail messages. It can be used to create new messages as well as parse an existing message. The aprMIME can be used with simple RFC 822 compliant messages, as well as RFC 1521 MIME compliant messages with multipart attachments.

 

When a message is parsed, it is broken into parts which each consist of two sections. The first is a header section which describes the format of the data and how it should be represented to the user. The second section is the data itself. A typical mail message without file attachments has one part, with the body of the message being the data. Messages with attachments have multiple parts, each with a header describing the type of data (for example, an executable program, a graphics image, and so on). The library can be then used to extract the data from the part and save it to a file on the local system, delete the part from the message, or add additional parts to the message (such as attaching a file).

 

 

Variables

 

cErr

Holds the Last Error description

 

Debug

Logical for Enabling / Disabling additional Debug messages

 

DebugTrace

Logical. Whether or not to include the Callstack in the Debug messages.

 

nErr

Holds the Last Error number

 

hMessage

Handle to the New / Current Message

 

 

 

Methods

 

New()

Initializes an Instance of the aprMIME Class

 

Destroy()

Releases resources for the Instance of the aprMIME Class

 

 

 

 

AppendMessageText()

Append text to the body of the current message part

 

AttachFile()

Attach a file to the specified message

 

AttachFileEx()

Attach a file to the message using the specified encoding method

 

ClearMessageText()

Clear the body of the current message part

 

CompareMessageText()

Compare text in the body of the current message part

 

CreateMessage()

Create a new message

 

CreateMessagePart()

Create a new message part for the specified message

 

DeleteMessage()

Delete the specified message

 

DeleteMessageHeader()

Delete the specified header field from the message

 

DeleteMessagePart()

Delete the specified message part

 

ExportMessage()

Export the the current message to a text file

 

ExtractFile()

Extract the file attachment from the current message part

 

EnumMessageHeaders()

Enumerate all header fields in the current message part

 

FormatDate()

Return a standard RFC 822 formatted date string

 

GetAttachedFileName()

Return the name of the file attachment for the current part

 

GetContentDigest()

Return encoded digest of message's content

 

GetContentLength()

Return the length of the current message part content

 

GetFileContentType()

Return the content type for a specified file

 

GetFirstMessageHeader()

Return the first header field and value in the current message part

 

GetMessageBoundary()

Return the multipart message boundary string

 

GetMessageDate()

Return the date and time from the message header

 

GetMessageHeader()

Return the value of a specified header from the message

 

GetMessagePart()

Returns the current message part index for the specified message.

 

GetMessagePartCount()

Return the total number of message parts

 

GetMessageText()

Import a message from the specified text file

 

GetMessageVersion()

Return the MIME version from the message header

 

GetNextMessageHeader()

Return the next header field and value in the current message part

 

ImportMessage()

Import a message from the specified text file

 

ParseBuffer()

Parse the specified text and add to the current message

 

ParseDate()

Parse the specified RFC 822 formatted date string

 

ParseHeader()

Parse the specified text and add to message header

 

ResetMessage()

Clear the specified message, deleting all message parts

 

SetExportOptions()

Specify a bitmask that describes current message export options

 

SetLastError()

Set the last error code

 

SetMessageDate()

Set the current date in the header for the specified message

 

SetMessageHeader()

Create or update a header field in the specified message

 

SetMessagePart()

Set the current message part index for the specified message

 

SetMessageText()

Create or update the specified message body

 

SetMessageVersion()

Set the MIME version for the specified message