MIME ActiveX Control
Copyright 1995 - 1997 by Distinct Corporation. All rights reserved.

Usage | Properties | Events | Methods | Header


1.1 Overview

1.1.1 Introduction

The Multi-purpose Internet Mail Extensions (MIME) is the Internet standard for sending e-mail messages that contain non US-ASCII character sets, enriched text, Gif images, and other types of files such as multimedia including audio and video. The Distinct MIME ActiveX control allows you to easily build applications that have MIME encoding and decoding capabilities. It can be used to build a stand-alone encoder, or used in conjunction with the SMTP, POP2/POP3 and NNTP ActiveX controls to send, receive and post encoded e-mail or news messages. The MIME ActiveX control supports RFC 822 (plain messages), MIME conformant Base 64 and Quoted printable, as well as uuencode and uudecode.

1.1.2 Usage

See the section entitled "Using Distinct ActiveX controls in various environments" on how to add the control to your project.

The MIME ActiveX control can be used to create a mail message or news article. The created file can then be sent using the SMTP (for mail messages) ActiveX control. If the POP2/POP3 ActiveX control is used to retrieve a mail message, the application can save the mail message to a file and use the MIME ActiveX control to extract the message. Similarly, for news articles, the MIME ActiveX control can be used to create a news article which can be posted using the NNTP ActiveX control.

After placing a MIME ActiveX control into a form, most properties can be set at design time. However, the application may want to request information from the user at runtime before setting the properties. The Source and Destination properties must be set before any action such as creating, extracting, encoding or decoding messages is performed. The Source property must be set to the complete path and filename of the source file. The Source property is not used for create message. The Destination property must be set to the destination filename or directory. For extract message, the Destination property must be a directory name.

The Action property can only be accessed at run time. To create a message, the value of the Action property must be set to ACTION_CREATE (or the Create method can be used). The To and From properties must be set before the ACTION_CREATE command. If the application is creating a MIME message, the IsMime property must be set to True; otherwise it must be set to False (in which case it would be a plain message). Also, the IsNews property must be set to True for a news article and to False for a mail message. The OnInformation, OnHeader and OnBody events will be fired to obtain the header and body of the message. The data in the body of the message can be binary by setting the UseVariant property to True. The OnBodyB event will be fired to obtain and the BodyB method can be called to pass binary data to the control. If an error occurs during the create process, an OnError event will be fired. The application can abort the creation of the message at any time by setting the Action property to ACTION_ABORT.

To extract a message, set the Action property to ACTION_EXTRACT (or call the Extract method). The message header, body and any attachments will extracted (and decoded if necessary) to the directory specified by the Destination property. The application will be notified the filename, content type, encoding used and other information through one or more OnExtract events. The number of attachments in the message can be obtained using the Attachments property after the extraction is complete.

Apart from creating and extracting messages, the MIME ActiveX control can be used to encode or decode files using the Base64 or Quoted-Printable formats. UUencode and UUdecode is also supported.

Back to Top


1.1.3 Property Summary

Action
Create, extract, encode or decode messages

Attachments
Number of attachments

Bcc
Blind carbon copy

Cc
Carbon copy

Charset
Character set

ContentId
Unique id for the content

ContentType
Content type for the message body or attachment

Date
Date and time

Destination
Destination path and filename

Encoding
Type of encoding used

FileName
Filename of the attachment

FileSize
File size of the attachment

From
Sender information

IsMime
MIME or non-MIME message

IsNews
News article or mail message

Lines
Number of lines in encoded file

MessageType
External or partial MIME message

Source
Source path and filename

Subject
Subject information

Subtype
Content subtype for the message body or attachment

To
Recipients

UseVariant
Send binary or ascii data

Back to Top


1.1.4 Event Summary

OnBody
Send message body or attachment file name

OnBodyB
Send message body or attachment file name as binary

OnError
Local error has occurred

OnExternal
Send information for external message

OnExtract
Obtain information about extracted message

OnHeader
Send header information

OnInformation
Send additional header information

OnPartial
Send information for partial message

OnStatistics
Number of bytes and lines in message header and body

Back to Top


1.1.5 Method Summary

Abort
Abort create message

Base64Decode
Decode a file using Base64 format

Base64Encode
Encode a file using Base64 format

BodyB
Send binary data in the body of message

Create
Create message

External
External message

Extract
Extract message

Partial
Partial message

QuotedDecode
Decode a file using quoted-printable format

QuotedEncode
Encode a file using quoted-printable format

UUdecode
UUdecode a file

UUencode
Uuencode a file

Back to Top


1.1.6 D_MIME.TXT

The following provides a complete listing of the D_MIME.TXT definition file. If your application uses more than one Distinct ActiveX control in the same form, then some definitions will conflict. For example, the FTP Client ActiveX control includes the definition

Global Const ACTION_DISCONNECT = 3

in the D_FTP.TXT file and the Telnet ActiveX control includes the definition

Global Const ACTION_DISCONNECT = 2

in the D_TNET.TXT file. To avoid this conflict, you must rename at least one of the constants (for example, FTP_ACTION_DISCONNECT or TNET_ACTION_DISCONNECT).

' MIME ActiveX Control
' (C) Copyright 1995 - 1997 by Distinct Corporation
' All rights reserved

' actions
Global Const ACTION_NONE = 0
Global Const ACTION_ABORT = 1
Global Const ACTION_CREATE = 2
Global Const ACTION_EXTRACT = 3
Global Const ACTION_UUENCODE = 4
Global Const ACTION_UUDECODE = 5
Global Const ACTION_BASE64_ENCODE = 6
Global Const ACTION_BASE64_DECODE = 7
Global Const ACTION_QUOTED_ENCODE = 8
Global Const ACTION_QUOTED_DECODE = 9

' message type
Global Const MESSAGE_NONE = 0
Global Const MESSAGE_EXTERNAL = 1
Global Const MESSAGE_PARTIAL = 2

' end of level indicator for multipart messages
Global Const END_OF_LEVEL = 19

' no header indicator
Global Const NO_HEADER = 20

' error codes
Global Const ERR_CANNOT_PERFORM_ACTION = 1
Global Const ERR_IN_ACTION = 2
Global Const ERR_CANNOT_ABORT = 3
Global Const ERR_CANNOT_CREATE = 4
Global Const ERR_CANNOT_EXTRACT = 5
Global Const ERR_CANNOT_UUENCODE = 6
Global Const ERR_CANNOT_UUDECODE = 7
Global Const ERR_CANNOT_BASE64_ENCODE = 8
Global Const ERR_CANNOT_BASE64_DECODE = 9
Global Const ERR_CANNOT_QUOTED_ENCODE = 10
Global Const ERR_CANNOT_QUOTED_DECODE = 11
Global Const ERR_PARTIAL_MESSAGE = 12
Global Const ERR_IN_CREATE = 13

Back to Top


1.2 Properties

1.2.1 Action

Summary

Create, extract, encode or decode messages.

Description

The Action property controls the state of the MIME ActiveX control. A message can be created, extracted or a file can be encoded or decoded by assigning one of the following values to this property.

Value Meaning
ACTION_ABORT Abort create message.
ACTION_CREATE Create message.
ACTION_EXTRACT Extract message.
ACTION_UUENCODE Encode using UUencode format.
ACTION_UUDECODE Decode using UUdecode format.
ACTION_BASE64_ENCODE Encode using Base64 format.
ACTION_BASE64_DECODE Decode using Base64 format.
ACTION_QUOTED_ENCODE Encode using Quoted-Printable format.
ACTION_QUOTED_DECODE Decode using Quoted-Printable format.

This property can be changed at run time only.

Before setting the Action property to ACTION_CREATE, the following properties must be initialized. The To property must be set to the mailing address (mail message) or the news group names (news article) of the recipients. The From property must be set to the mailing address of the sender. The Subject, Cc and Bcc properties are optional parameters and can be left as empty strings. The IsMime and IsNews property must be set correctly. Plain messages can be plain text or uuencoded. MIME messages can be base64 encoded, quoted-printable encoded or plain text. The encoding is done by the MIME ActiveX control. For MIME messages, apart from the above the ContentId, ContentType, Subtype and Charset (optional) have to be set before creating the message. The MessageType property must be set for partial or external MIME messages. The Destination property must be set to the destination file name. The OnInformation, OnHeader and OnBody events will be fired to obtain the message header and body as well as any attachments. Once the header and body of the message is composed, the OnStatistics event is fired with the number of lines and number of bytes in the header and body of the message. For partial messages, the OnPartial event will be fired to obtain the part number and id and for external messages, the OnExternal event will be fired to obtain the access type and other pertaining information. Please check the reference page of the individual properties for more information.

To abort the create message, set the Action property to ACTION_ABORT during the OnInformation, OnHeader, OnBody or OnStatistics event. The action in progress will be canceled and no further such events will occur.

To extract a message, set the Action property to ACTION_EXTRACT with the Source and Destination properties set to the source file and the destination directory. The message header and body are extracted first and saved in the destination directory. The OnExtract event will be fired to inform the application about the filename, encoding type, content type, subtype and level. The FileName, Encoding, ContentType and Subtype properties will be set with the appropriate values before the OnExtract event is fired. If there are any attachments, they will be extracted and the OnExtract event will contain the information. All encoded files will be decoded and then saved. For Partial messages, the OnExtract message will be fired only when all the parts of the message have been extracted and reassembled.

To UUencode a file, set the Action property to ACTION_UUENCODE with the Source and Destination properties set. The FileName property must be set to the name that will be used during encoding. This is necessary to preserve the original name of the file during the decoding process at the receiving end. The number of lines in the encoded file is returned in the Lines property after the encoding. If the Destination property is an empty string, then the encoded output is not generated but the Lines property will contain the number of lines in the encoded file. This information is necessary while building the header for a uuencoded message.

To UUdecode a file, set the Action property to ACTION_UUDECODE with the Source and Destination properties set. Once the file has been decoded, the FileName property will contain the name of the original file used during the UUencode process. The application may want to rename the decoded file to its original name.

MIME messages have two encoding formats: Base64 and Quoted-printable. The Base64 encoding format is more widely used. The quoted-printable encoding is used when the file is mostly ASCII characters but also contains special characters or very long lines. The Source and Destination properties must be set for these encoding and decoding formats.

To encode using base64 format, set Action property to ACTION_BASE64_ENCODE and to decode a base64 encoded file, set the Action property to ACTION_BASE64_DECODE. To encode using quoted-printable format, set Action property to ACTION_QUOTED_ENCODE and to decode a quoted-printable encoded file, set the Action property to ACTION_QUOTED_DECODE.

If an error occurs, then the OnError event will be fired. The application should set a flag in the OnError event, so that it can determine if the action was successful. In addition, the application may want to display an error message in the OnError event to inform the user of the error. Please check the reference page of the OnError event for a complete listing of error codes.

The Abort, Create, Extract, UUencode, UUdecode, Base64Encode, Base64Decode, QuotedEncode and QuotedDecode methods accomplish the same as the above actions. Please check the reference pages of these methods for more detailed information on their usage.

There is no default value for the Action property.

Example

Mime.Destination = "c:\temp\test.msg" ' plain message
Mime.Action = ACTION_CREATE

Back to Property Summary


1.2.2 Attachments

Summary

Number of attachments.

Description

The Attachments property specifies the number of attachments contained in the extracted message. To extract a message set the Action property to ACTION_EXTRACT or call the Extract method. If the Attachments property is referenced after the ACTION_EXTRACT command or the Extract method and no errors have occurred it will contain the number of attachments. At all other times, this property will contain 0.

The Attachments property is a read-only property and cannot be set at any time. The property can be referenced only during run time. The default value for this property is 0.

Example

Dim Message As String

Message = "Number of attachments: " & Mime.Attachments
MsgBox Message, 64, "Sample Program"

Back to Property Summary


1.2.3 Bcc

Summary

Blind carbon copy.

Description

The Bcc property is used to identify additional recipients of the mail message. The contents of this property is used to build the "Bcc" field of the mail header. This is an optional property. The Bcc property, if used, must be set before setting the Action property to ACTION_CREATE. This property is ignored if the message is a news article.

The contents of the "Bcc" field are not included in the copies of the mail message sent to the primary (specified in the To property) and the secondary (specified by the Cc property) recipients. Some mail servers may include the text of this field only in the sender's copy (specified by the From property), while others may include it in the text sent to all recipients indicated in the "Bcc" field.

This property can be changed at design time and at run time (before creating a message). There is no default value for this property.

Example

Mime.To = "santa"
Mime.Cc = "elves"
Mime.Bcc = "children"
......
Mime.Action = ACTION_CREATE

Back to Property Summary


1.2.4 Cc

Summary

Carbon copy.

Description

The Cc property is used to identify the secondary recipients of the mail message. The contents of this property is used to build the "Cc" field of the mail header. This is an optional property. The Cc property, if used, must be set before setting the Action property to ACTION_CREATE. This property is ignored if the message is a news article.

This property can be changed at design time and at run time (before creating a message). There is no default value for this property.

Example

Mime.To = "santa"
Mime.Cc = "elves"
Mime.Bcc = "children"
......
Mime.Action = ACTION_CREATE

Back to Property Summary


1.2.5 Charset

Summary

Character set.

Description

The Charset property specifies the character set used for the message. This property is important for text messages. The message body must contain only characters from the given character set. The default value is "us-ascii".

The Charset property is optional. If used, it must be set before setting the Action property to ACTION_CREATE.

This property can be changed at design time and at run time (before creating a message). There is no default value for this property.

Example

Mime.Charset = "us-ascii"

Back to Property Summary


1.2.6 ContentId

Summary

Unique id for the content.

Description

The ContentId property specifies a unique id for the contents of the MIME message. This property is used to build the "Content-ID" field of the header. The value of the ContentId property will be used to uniquely identify a MIME message. This is especially important for an "external" message. An "external" message is one whose ContentType property is set to "message" and the Subtype property is set to "external-body". The MessageType property is set to MESSAGE_EXTERNAL (the External method can also be used).

The ContentId property is mandatory for an external message.

This property can be changed at design time and changed at run time before creating a message. There is no default value for this property.

Example

Mime.ContentId = id129@foo.com

Back to Property Summary


1.2.7 ContentType

Summary

Content type for the message body or attachment.

Description

The purpose of the ContentType property is to describe the data contained in the body of the message or attachment. The ContentType property and the Subtype property together specify the "Content Type" field of the header. The ContentType property can be set to one of the following values.

Value Meaning
"text" Textual information.
"audio" Audio data.
"video" Video data.
"image" Image data.
"message" Encapsulated message.
"multipart" Multiple parts of independent types.
"application" Uninterpreted binary data.

Each content type has one or more subtypes. Please check the reference page of the Subtype property for additional information. The ContentType and Subtype properties are mandatory for MIME messages.

When a message is extracted, this property will contain the content type of the extracted file. Please check this property during the OnExtract event. A ContentType of "image" and Subtype of "gif" tells the application that the data is an image and this information may be used to display the raw data.

This property can be changed at design time and changed at run time before creating a message. There is no default value for this property.

Example

Mime.ContentType = "multipart"
Mime.Subtype = "mixed"

Back to Property Summary


1.2.8 Date

Summary

Date and time.

Description

The Date property must be set to a string containing the date and time. The format of the string must be compliant with the RFC 850 specification or RFC 822 specification. This property can be accessed at any time. This property is used to build the "Date" field in the header.

By default, the MIME ActiveX control will use the current date and time to build the "Date" field. However, an application can change this by setting the Date property to a different date and time. For example: "Fri, Apr 5 1996 10:05:06" is a valid date string. If the Date property is an empty string then the default date and time will be used. This property must be set before creating a message.

Please refer to RFC 850 - "Standard For Interchange of USENET Messages" or to RFC 822 - "Standard For The Format Of ARPA Internet Text Messages" for more information on the format of the date string.

This property can be set at design time or changed at run time. There is no default value for this property.

Example

Mime.Date = Format$(Now, "ddd, d mmm yyyy hh:mm:ss")

Back to Property Summary


1.2.9 Destination

Summary

Destination path and filename.

Description

The Destination property specifies the destination filename or directory name. this property must be set before setting the Action property. The Destination property must contain the entire path and filename of the destination file for all actions other than ACTION_EXTRACT. For ACTION_EXTRACT, the Destination property must be set to the destination directory name.

This property can be changed at any time. There is no default value for this property.

Example

Mime.Source = "c:\temp\file.1"
Mime.Destination = "c:\temp"
Mime.Action = ACTION_EXTRACT

Back to Property Summary


1.2.10 Encoding

Summary

Type of encoding used.

Description

The Encoding property specifies the type of encoding to be used for the message. This property is used to build the "Encoding" field of the header. The Encoding property must be set before setting the Action property to Action create and also inside the OnHeader event for attachments. The Encoding property can be assigned one of the following values.

Value Meaning
"text" No encoding - plain text.
"base64" Base64 encoding.
"quoted-printable" Quoted-printable encoding.
"uuencode" UUencode.

The MIME control uses this field to automatically encode the file while creating the message.

For non-MIME messages, the Encoding property can be set to "text" or "uuencode". For MIME messages, the Encoding property can be set to "text", "base64" or "quoted-printable".

When a message is extracted, this property will contain the type of encoding used for the extracted file. The extracted file will be decoded automatically by the MIME control. Please check this property during the OnExtract event. The value of this property will change with each OnExtract event.

This property can be changed at any time. There is no default value for this property.

Example

Mime.Encoding = "quoted-printable"

Back to Property Summary


1.2.11 FileName

Summary

Filename of the attachment.

Description

The FileName property specifies the filename of the attachment or the original name of the uuencoded file.

During create message, the FileName property must be set to the filename of the attachment in the OnHeader event. The FileName property must not contain any path information.

During extract message, the FileName property will set the name of the extracted file containing the message header, body and attachments. This information is obtained in the OnExtract event.

While UUencoding a file, set the FileName property to the original file name to preserve the original name of the file. This name will be returned in the FileName property if the file is decoded using the UUdecode format. The application can rename the decoded file to its original name using the FileName property.

The FileName property is also used in the OnExternal event for external messages. Refer to the OnExternal event for more details.

This property can be changed at any time. There is no default value for this property.

Example

Mime.Source = "c:\temp\myzip.zip"
Mime.Destination = "c:\temp\test.uue"
Mime.FileName = "myzip.zip"
Mime.Action = ACTION_UUENCODE

Back to Property Summary


1.2.12 FileSize

Summary

File size of the attachment.

Description

The FileSize property specifies the file size of the attachment. This is an optional parameter while creating a message and is used to build the "SizeOnDisk" field of the header.

This property must be set to the size of the file specified by the FileName property for an attachment during the OnHeader event.

This property can be changed at any time. The default value for this property is 0.

Example

Mime.FileName = "c:\temp\myfile.txt"
Mime.FileSize = FileLen(Mime.FileName)

Back to Property Summary


1.2.13 From

Summary

Sender information.

Description

The From property specifies the mailing address of the person sending the message. The value of the From property is used to build the "From" field of the header. This property must be set before creating a message (by setting the Action property to ACTION_CREATE).

This property cannot contain lists or group names.

This property can be changed at design time and at run time (before creating a message). There is no default value for this property.

Example

Mime.From = "santa"
Mime.To = "anybody"
......
Mime.Action = ACTION_CREATE

Back to Property Summary


1.2.14 IsMime

Summary

MIME or non-MIME message.

Description

The IsMime property specifies whether the message to be created is a MIME message or a non-MIME message. This property must be set to the appropriate value before setting the Action property to ACTION_CREATE.

The IsMime property must be set to True for a MIME message and to False for a non-MIME message.

This property can be changed at design time and at run time (before creating a message). There is no default value for this property.

Example

Mime.Destination = "c:\temp\test.msg"
Mime.IsMime = True
Mime.ContentType = "message"
Mime.Subtype = "partial"
Mime.Action = ACTION_CREATE

Back to Property Summary


1.2.15 IsNews

Summary

News article or mail message.

Description

The IsNews property specifies whether the message to be created is a mail message or a news article. This property must be set to the appropriate value before setting the Action property to ACTION_CREATE.

The IsNews property must be set to True for a news article or False for a mail message. If this property is set to True, then the To property must be set to the names of the news groups receiving the article. If the IsNews property is False, the To property must be set to the mailing addresses of the recipients of the mail message.

This property can be changed at design time and at run time (before creating a message). There is no default value for this property.

Example

Mime.IsNews = True ' news article

Back to Property Summary


1.2.16 Lines

Summary

Number of lines in encoded file.

Description

The Lines property specifies the number of lines contained in the encoded file. This property will be set after a uuencode or base64 encode command. At all other times, this property will be 0. To uuencode a file, set the Action property to ACTION_UUENCODE or call the UUencode method. To encode a file using the Base64 format, set the Action property to ACTION_BASE64_ENCODE or call the Base64Encode method.

This property is a read-only property and cannot be set at any time. The property can be referenced during run time. The default value for this property is 0.

Example

Dim Message As String

Mime.Source = "c:\temp\myzip.zip"
Mime.FileName = "myzip.zip"
Mime.Action = ACTION_UUENCODE

Message = "Number of lines: " & Mime.Lines
MsgBox Message, 64, "Sample Program"

Back to Property Summary


1.2.17 MessageType

Summary

External or partial MIME message.

Description

The MessageType property must be set for a partial or external MIME message. The following values can be assigned to the MessageType property.

Value Meaning
MESSAGE_NONE None.
MESSAGE_EXTERNAL External message.
MESSAGE_PARTIAL Partial message.

A partial message is a MIME message whose ContentType is "message" and Subtype is "partial". This is generally used to send very large files in many parts. The various parts will be reassembled on the receiving end. If the application is creating a partial message, then the MessageType must be set to MESSAGE_PARTIAL. The OnPartial event will be fired to obtain the information for the partial message. The OnPartial event will be fired only if the MessageType property is set. A partial message cannot be a body part of a multipart message.

An external message is a MIME message whose ContentType is "message" and Subtype is "external-body". This is generally used to reference an external data source. The actual data is not included in the body part. If the application is creating an external message, then the MessageType must be set to MESSAGE_EXTERNAL. The OnExternal event will be fired to obtain the information for the external message. The OnExternal event will be fired only if the MessageType property is set.

If the external message is part of a multipart message, then MessageType property must be set to MESSAGE_EXTERNAL inside the OnHeader event for that attachment and then reset to MESSAGE_NONE immediately.

The External and Partial methods can also be used to set the message type. Please check the reference pages of these methods for more detailed information on their usage.

This property can be changed at design time and at run time before creating a message. The default value for this property is MESSAGE_NONE.

Example

Mime.MessageType = MESSAGE_PARTIAL
.......
Mime.Action = ACTION_CREATE

Back to Property Summary


1.2.18 Source

Summary

Source path and filename.

Description

The Source property specifies the source filename. This property must be set before setting the Action property. The Source property is not used during create message and therefore does not need to be set before setting the Action property to ACTION_CREATE.

The Destination property must be set to the complete path and filename of the source.

This property can be changed at any time. There is no default value for this property.

Example

Mime.Source = "c:\temp\file.1"
Mime.Destination = "c:\temp\file.2"
Mime.Action = ACTION_BASE64_DECODE

Back to Property Summary


1.2.19 Subject

Summary

Subject information.

Description

The Subject property provides a summary of the message or indicates the nature of the message to be created. The contents of this property is used to build the "Subject" field of the header. This is an optional parameter and is generally used to provide insight about the contents of the message.

The Subject property, if used, must be set before setting the Action property to ACTION_CREATE. The Subject property can be set to an empty string.

This property can be changed at design time and at run time before a connection has been established. The default value for this property is port 79.

Example

Mime.Subject = "Testing..."
.......
Mime.Action = ACTION_CREATE

Back to Property Summary


1.2.20 Subtype

Summary

Content subtype for the message body or attachment.

Description

The purpose of the Subtype property is to describe the subtype of the data contained in the body of the message or attachment. The ContentType property and the Subtype property together specify the "Content Type" field of the header. The Subtype property values differ depending on the ContentType property. Some of the subtypes are listed below.

ContentType Subtype Meaning
"text" "plain" Plain unformatted text.
"audio" "basic" Audio format.
"video" "mpeg" Video format.
"image" "gif" GIF image format
  "jpeg" JPEG image format.
"message" "partial" Fragmented transmission of messages (if original is too large).
  "external-body" Reference to an external body source.
"multipart" "mixed" Body parts with independent types.
  "alternative" Alternative versions of the same information.
  "digest" Multipart entities of ContentType "message".
  "parallel" Parts intended to be viewed simultaneously.
"application" "octet-stream" Uninterpreted binary data.

A ContentType of "message" and Subtype of "partial" is a partial message where the source is sent in parts. A ContentType of "message" and Subtype of "external-body" is an external message which contains only a reference to the data source and not the data itself.

When a message is extracted, this property will contain the subtype of the extracted file. Please check this property during the OnExtract event. A ContentType of "image" and Subtype of "gif" tells the application that the data is an image and this information may be used to display the raw data.

This property can be changed at design time and at run time before creating a message. There is no default value for this property.

Example

Mime.ContentType = "multipart"
Mime.Subtype = "mixed"

Back to Property Summary


1.2.21 To

Summary

Recipients.

Description

The To property specifies the primary recipients of the mail message or the news article. For a mail message, this property is used to build the "To" field of the header. For a news article, this property is used to build the "NewsGroups" field of the header. This property must be set before the Action property is set to ACTION_CREATE.

If the IsNews property is set to True, then the To property must be set to the names of the news groups receiving the article. If the IsNews property is False, then the To property must contain the mailing addresses of the recipients of the mail message.

Example

Mime.To = "santa"
......
Mime.Action = ACTION_CREATE

Back to Property Summary


1.2.22 UseVariant

Summary

Send binary or ascii data.

Description

The UseVariant property is used to specify whether data is to be sent in binary or ASCII form. If this property is set to True, the OnBodyB event will be fired when a message is being created; otherwise the OnBody event is fired.

This property should be set before an attempt is made to create a message. This property can be read at any time. The default value for this property is False.

Example

Mime.UseVariant = True

Back to Property Summary


1.3 Events

1.3.1 OnBody

Summary

Send message body or attachment file name.

Description

The OnBody event occurs in response to setting the Action property to ACTION_CREATE. During the create message process, the OnBody event will be fired to obtain the body of the message as well as the attachments.

The MIME ActiveX control will first fire the OnBody event to obtain the body of the message. Assign the body to Buffer and set Length to the length of Buffer. The IsFile parameter should be set to 0. Once the MIME control builds the main header and body of the message, it will fire the OnHeader and OnBody events to obtain information for the attachments.

To send the attachment, simply set the complete path and name of the file to the Buffer parameter and Length to the length of the buffer string. The IsFile parameter should be set to 1.

To indicate the end of the message body or attachment set Buffer to an empty string and Length to 0.

To abort the create message, set the Action property to ACTION_ABORT (or call the Abort method) during this event. The action in progress will be canceled and no further such events will occur.

Example

' HeaderInfo is a structure for the attachment name, encoding used and the content type
' see the MIME sample for the definition

Sub Mime_OnBody (Buffer As String, Length As Integer, IsFile As Integer)
' send message body
If MsgBodyDone = False Then
Buffer = Message
Length = Len(Message)
IsFile = 0 ' message body
MsgBodyDone = True
Exit Sub
End If

' send attachment filename
If AttachDone = False And HeaderIndex <> 0 Then
Buffer = HeaderInfo(Indx).FilePath

 

Length = Len(HeaderInfo(Indx).FilePath)
IsFile = 1 ' attachment
AttachDone = True
Else
Buffer = "" ' end of body or attachment
Length = 0
IsFile = 0
End If
End Sub

Back to Event Summary


1.3.2 OnBodyB

Summary

Send message body or attachment file name as binary.

Description

The OnBodyB event occurs in response to setting the Action property to ACTION_CREATE. During the create message process, the OnBodyB event will be fired to obtain the body of the message as well as the attachments. The UseVariant property must be set to True. If the UseVariant property is False, then the OnBody event will be received instead. The Byte argument passed to this event indicates the maximum number of bytes of data can be sent at this moment.

The MIME ActiveX control will first fire the OnBodyB event to obtain the body of the message. During the OnBodyB event, call the BodyB method. Pass the body as the Buffer parameter, pass the length of the body as the Bytes parameter and pass 0 as the IsFile parameter. Once the MIME control builds the main header and body of the message, it will fire the OnHeader and OnBodyB events to obtain information for the attachments.

To send the attachment, simply pass the complete path and name of the file to the Buffer parameter and the length of the Buffer as the Bytes parameter. The IsFile parameter should be set to 1.

To indicate the end of the message body or attachment pass 0 as the Bytes parameter of the BodyB method.

To abort the create message, set the Action property to ACTION_ABORT (or call the Abort method) during this event. The action in progress will be canceled and no further such events will occur.

Example

' HeaderInfo is a structure for the attachment name, encoding used and the content type
' see the MIME sample for the definition

Sub Mime_OnBodyB (Bytes As Long)
' send message body
If MsgBodyDone = False Then
Result = BodyB (Buffer, BufferLength, 0) ' message body
MsgBodyDone = True
Exit Sub
End If

' send attachment filename
If AttachDone = False And HeaderIndex <> 0 Then
Result = BodyB (HeaderInfo(Indx).Buffer, BufferLength, 1) ' attachment
AttachDone = True
Else
Result = BodyB (Buffer, 0, 0) ' end of body or attachment
End If
End Sub

Back to Event Summary


1.3.3 OnError

Summary

Local error has occurred.

Description

The OnError event occurs when a property is accessed in an illegal way or when a connection with the remote server cannot be established. The table below lists all possible error codes delivered by this event.

Value Meaning
ERR_CANNOT_PERFORM_ACTION Unable to initialize.
ERR_IN_ACTION Another action is in progress.
ERR_CANNOT_ABORT Cannot abort action.
ERR_CANNOT_CREATE Create message failed.
ERR_CANNOT_EXTRACT Extract message failed.
ERR_CANNOT_UUENCODE UUencode failed.
ERR_CANNOT_UUDECODE UUdecode failed.
ERR_CANNOT_BASE64_ENCODE Base64 encoding failed.
ERR_CANNOT_BASE64_DECODE Base64 decoding failed.
ERR_CANNOT_QUOTED_ENCODE Quoted-printable encoding failed.
ERR_CANNOT_QUOTED_DECODE Quoted-printable decoding failed.
ERR_PARTIAL_MESSAGE Extracted partial message.
ERR_IN_CREATE UseVariant cannot be set during message create.

The following describes each error in more detail.

ERR_CANNOT_PERFORM_ACTION
Unable to initialize the underlying Distinct support files. There may be a license violation.

ERR_IN_ACTION
Another action is already in progress.

ERR_CANNOT_ABORT
The Abort method or the Action property can only be set to ACTION_ABORT while creating a message (using ACTION_CREATE). ACTION_ABORT or the Abort method cannot be used under any other circumstances.

ERR_CANNOT_CREATE
The create message (by setting the Action property to ACTION_CREATE or by calling the Create method) failed. Make sure that the mandatory properties are set and the Destination property has a correct value.

ERR_CANNOT_EXTRACT
The extract message (by setting the Action property to ACTION_EXTRACT or by calling the Extract method) failed. The Destination property must be set to a directory name.

ERR_CANNOT_UUENCODE
UUencode (by setting the Action property to ACTION_UUENCODE or by calling the UUencode method) failed. Please set the FileName, Source and Destination properties correctly.

ERR_CANNOT_UUDECODE
UUdecode (by setting the Action property to ACTION_UUDECODE or by calling the UUdecode method) failed. Please set the Source and Destination properties correctly.

ERR_CANNOT_BASE64_ENCODE
Base64 encode (by setting the Action property to ACTION_BASE64_ENCODE or by calling the Base64Encode method) failed. Please set the FileName, Source and Destination properties correctly.

ERR_CANNOT_BASE64_DECODE
Base64 decode (by setting the Action property to ACTION_BASE64_DECODE or by calling the Base64Decode method) failed. Please set the Source and Destination properties correctly.

ERR_CANNOT_QUOTED_ENCODE
Quoted-printable encode (by setting the Action property to ACTION_QUOTED_ENCODE or by calling the QuotedEncode method) failed. Please set the FileName, Source and Destination properties correctly.

ERR_CANNOT_QUOTED_DECODE
Quoted-printable decode (by setting the Action property to ACTION_QUOTED_DECODE or by calling the QuotedDecode method) failed. Please set the Source and Destination properties correctly.

ERR_PARTIAL_MESSAGE
One part of a partial message was extracted. This is not an error but simply informational. When all the parts are extracted, the MIME control will reassemble the message and fire the OnExtract event with all the information.

ERR_IN_CREATE
During message create, the UseVariant property cannot be changed.

Example

Sub Mime_OnError (ErrorCode As Integer)
If ErrorCode = ERR_CANNOT_CREATE Then
MsgBox "Unable to create message", 64, "Sample Program"
End If
End Sub

Back to Event Summary


1.3.4 OnExternal

Summary

Send information for external message.

Description

The OnExternal event will occur if the MessageType property is set to MESSAGE_EXTERNAL or if the External method is used before creating a message. To create a message, set the Action property to ACTION_CREATE or call the Create method.

Though this event has nine parameters, not all of them are mandatory. Depending on the AccessType parameter some parameters become mandatory.

The AccessType parameter specifies the protocol and can be set to "FTP", "ANON-FTP", "TFTP" or "MAIL-SERVER".

For "FTP", "ANON-FTP" and "TFTP" access types, the FileName property must be set to name of the file that contains the actual data. The Site parameter must be set to the name of the machine from which the file may be obtained. This must be a fully qualified domain name. The Directory parameter is optional and can be set to the directory where the files resides. The Mode parameter is also optional and specifies the mode to be used while retrieving. For "FTP" and "ANON-FTP" access type, Mode can be "ASCII", "IMAGE" or "EBCDIC". For "TFTP" access type, Mode can be "NETASCII", "OCTET" or "MAIL".

A "MAIL-SERVER" access type indicates that the actual body is available from a mail server. The Server parameter is mandatory in this case and must be set to the e-mail address of the mail server from which the actual body may be obtained. The Subject parameter is optional and specifies the subject that is to be used in the mail sent to obtain the data.

The Size parameter specifies the size of the data and is optional for all access types. The Expiration parameter specifies the expiration date of the external data and is optional for all access types. The Permission parameter specifies the read-write permissions of the external data and is optional for all access types.

Example

Sub Mime_OnExternal (Subject As String, Site As String, AccessType As String,
Directory As String, Mode As String, Server As String,
Permission As String, Expiration As String, Size As Long)
AccessType = "anon-ftp"
Mime.FileName = "test.exe"
Mode = "image"
Site = "127.43.101.12"
Directory = "pub"
End Sub

Back to Event Summary


1.3.5 OnExtract

Summary

Obtain information about extracted message.

Description

The OnExtract event occurs in response to setting the Action property to ACTION_EXTRACT (or the Extract method). This event will occur during the extract message.

The MIME ActiveX control will first extract the message header and body and save it to a file. The OnExtract event will be fired after this. Next, the attachments will be extracted, decoded if necessary and saved to a file. The OnExtract event will be fired for each attachment.

The application can check the FileName property to determine the name of the file containing the extracted information. The Encoding property, ContentType and Subtype properties will contain the appropriate information.

The value of these properties will change with each occurrence of the OnExtract event.

The Level parameter will contain the level of nesting for multipart nested messages. Otherwise it will be 0.

For a partial message, the OnExtract event will only be fired when all the parts have been extracted and reassembled to form the original file. Otherwise an OnError event will occur to indicate that a partial message was extracted.

Example

Sub Mime_OnExtract (Level As Integer)
' display
Message = "Extracted...." + Chr(10) + Chr(10)

' filename
Message = Message & "FileName: " & Mime.FileName & Chr(10)

Message = Message & "Level: " & Level & Chr(10)

' encoding type
Message = Message & "Encoding: " & Mime.Encoding & Chr(10)

' content type
Message = Message & "ContentType: " & Mime.ContentType & Chr(10)

' subtype
Message = Message & "SubType: " & Mime.Subtype & Chr(10)

' display message
MsgBox Message, 64, "Sample Program"
End Sub

Back to Event Summary


1.3.6 OnHeader

Summary

Send header information.

Description

The OnHeader event will be fired during the create message to obtain the header information for the attachments. The ContentId, Encoding, ContentType and Subtype properties must be set appropriately. The Charset property may be set to a valid character set. Please check the reference pages for additional information.

For non-MIME messages, set Status to 0 to indicate the end of the header. For MIME messages, set the Status parameter to END_OF_LEVEL to indicate end of header. Otherwise, set Status to 1.

If there is no header, set Status to NO_HEADER. This indicates that there is no header and the body will not be encoded.

For a partial message, the first part must include the header of the encapsulated message. The ContentType and Subtype properties must be specified for the encapsulated message (such as "image", "audio", "video", etc.). All other parts will not have a header

To abort the create message, set the Action property to ACTION_ABORT (or call the Abort method) during this event. The action in progress will be canceled and no further such events will occur.

Example

Sub Mime_OnHeader (Status As Integer)
' no attachments
If (HeaderIndex = 0) Then
Status = 0
Exit Sub
End If

' increment Indx
Indx = Indx + 1

' finished all attachments
If (Indx >= HeaderIndex) Then
If (MsgType = 1 Or MsgType = 0) Then
Status = 0 ' plain message
Else
Status = END_OF_LEVEL ' mime message
End If
Exit Sub
End If

' fill fields
If MsgType = 1 Then ' plain message
'check encoding
If HeaderInfo(Indx).Encoding = TYPE_TEXT Then
Mime.Encoding = "text"
Else
Mime.Encoding = "uuencode"
End If

ElseIf MsgType = 2 Then ' mime message
'check encoding
If HeaderInfo(Indx).Encoding = BASE64_ENCODED Then
Mime.Encoding = "base64"
ElseIf HeaderInfo(Indx).Encoding = QUOTED_ENCODED Then
Mime.Encoding = "quoted-printable"
Else
Mime.Encoding = "text"
End If

' check mime filetype
If HeaderInfo(Indx).Type = TYPE_AUDIO Then
Mime.ContentType = "audio"
Mime.Subtype = "basic"
ElseIf HeaderInfo(Indx).Type = TYPE_VIDEO Then
Mime.ContentType = "video"
Mime.Subtype = "basic"
ElseIf HeaderInfo(Indx).Type = TYPE_IMAGE Then
Mime.ContentType = "image"
Mime.Subtype = "gif"
ElseIf HeaderInfo(Indx).Type = TYPE_APPLICATION Then
Mime.ContentType = "application"
Mime.Subtype = "octet-stream"
Else
Mime.ContentType = "text"
Mime.Subtype = "plain"
End If
End If

' set filename
Mime.FileName = HeaderInfo(Indx).Filename
AttachDone = False
Status = 1
End Sub

Back to Event Summary


1.3.7 OnInformation

Summary

Send additional header information.

Description

The OnInformation event occurs in response to setting the Action property to ACTION_CREATE or calling the Create method. Additional header information may be sent in this event. Applications may want to add specific information in the headers such as an "X-Mailer" field. Such fields can be sent using this event.

This event must be processed even if the application does not have additional header fields to be sent. To indicate the end of the additional headers set Buffer to an empty string and Length to 0. Otherwise fill the Buffer string and set the Length parameter to the length of the buffer. This information will be used inside the message header.

To abort the create message, set the Action property to ACTION_ABORT (or call the Abort method) during this event. The action in progress will be canceled and no further such events will occur.

Example

Sub Mime_OnInformation (Buffer As String, Length As Integer)
Buffer = ""
Length = 0
End Sub

Back to Event Summary


1.3.8 OnPartial

Summary

Send information for partial message.

Description

The OnPartial event will occur if the MessageType property is set to MESSAGE_PARTIAL or if the Partial method is used before creating a message. To create a message, set the Action property to ACTION_CREATE or call the Create method.

For a partial message, the parameters Number, Total and Id are mandatory. The application must set the Number parameter to the part number which indicates where this part fits into the sequence of parts. The Total is the total number of parts. The Id is a unique identifier which is common to all the parts and is used to match the parts.

For a partial message, the first part must include the header of the encapsulated message. All other parts will not have a header

Example

Sub Mime_OnPartial (Number As Integer, Total As Integer, Id As String)
Number = 1 ' first part
Total = 3 ' totally 3 parts
Id = "uniqueid1234"
End Sub

Back to Event Summary


1.3.9 OnStatistics

Summary

Number of bytes and lines in message header and body.

Description

The OnStatistics event will occur in response to the Action property being set to ACTION_CREATE or in response to calling the Create method. Once the header and body of the message is created, the MIME control will fire the OnStatistics event to deliver the number of lines and number of bytes in the message header and body. This event will be fired before the MIME control requests for information about the attachments.

Only one OnStatistics event will occur to deliver the information. The application can then display this summary information to the user.

To abort the create message, set the Action property to ACTION_ABORT (or call the Abort method) during this event. The action in progress will be canceled and no further such events will occur.

Example

Sub Mime_OnStatistics (Lines As Integer, Bytes As Long)
' display statistics
Message = "---------- Statistics ----------- " + Chr(10) + Chr(10)
Message = Message & "Lines (total): " & Lines & Chr(10)
Message = Message & "Bytes (total): " & Bytes & Chr(10)

' display message
MsgBox Message, 64, "Sample Program"
End Sub

Back to Event Summary


1.4 Methods

1.4.1 Abort

Summary

Abort create message.

Syntax

Boolean Abort ()

Description

To abort the create message, call the Abort method during the OnInformation, OnHeader, OnBody or OnStatistics event. The action in progress will be canceled and no further such events will occur.

This method must be called only during create message. If this method is called at any other time, the Abort method will fail and an OnError event will be fired.

The Abort method returns True if successful; otherwise, it returns False. Calling this method is equivalent to setting the Action property to ACTION_ABORT.

Example

Result = Mime.Abort ()
If Result = False Then
MsgBox "Unable to abort", 64, "Sample Program"
Exit Sub
End If

Back to Method Summary


1.4.2 Base64Decode

Summary

Decode a file using base64 format.

Syntax

Boolean Base64Decode (Src, Dest)
  Src String
  Dest String

Description

To decode a file using Base64 format, call the Base64Decode method with the Src and Dest parameters set. The Src parameter must be set to source path and filename and Dest parameter must be set to the destination path and filename.

If an error occurs, then the OnError event will be fired. The application should set a flag in the OnError event, so that it can determine if the action was successful. In addition, the application may want to display an error message in the OnError event to inform the user of the error. Please check the reference page of the OnError event for a complete listing of error codes.

The Base64Decode method returns True if successful; otherwise, it returns False. Calling this method is equivalent to setting the Action property to ACTION_BASE64_DECODE.

Example

Result = Mime.Base64Decode ("c:\temp\file.1", "c:\temp\file.2")
If Result = True Then
MsgBox "Decoded successfully", 64, "Sample Program"
Exit Sub
End If

Back to Method Summary


1.4.3 Base64Encode

Summary

Encode a file using base64 format.

Syntax

Boolean Base64Encode (Src, Dest)
  Src String
  Dest String

Description

To encode a file using Base64 format, call the Base64Encode method with the Src and Dest parameters set. The Src parameter must be set to source path and filename and Dest parameter must be set to the destination path and filename.

If an error occurs, then the OnError event will be fired. The application should set a flag in the OnError event, so that it can determine if the action was successful. In addition, the application may want to display an error message in the OnError event to inform the user of the error. Please check the reference page of the OnError event for a complete listing of error codes.

The Base64Encode method returns True if successful; otherwise, it returns False. Calling this method is equivalent to setting the Action property to ACTION_BASE64_ENCODE.

Example

Result = Mime.Base64Encode ("c:\temp\file.1", "c:\temp\file.2")
If Result = True Then
MsgBox "Encoded successfully", 64, "Sample Program"
Exit Sub
End If

Back to Method Summary


1.4.4 BodyB

Summary

Send binary data in the body of message.

Syntax

Boolean BodyB (Buffer, Bytes, IsFile)
  Buffer Variant
  Bytes Long
  IsFile Boolean

Description

The BodyB method creates a message with binary data as the body of the message. The application should not pass more data than the maximum specified by the Bytes argument of the OnBodyB event to this method.

The BodyB method takes a buffer (Buffer), the number of bytes in the buffer (Bytes), and a buffer flag as its parameters and returns a boolean. The Buffer parameter should be an array of bytes data type. The Bytes parameter must contain the number of bytes of the buffer. The IsFile indicates whether the data in the buffer is the body of the message or attachments. If the data is successfully sent, then the method returns True; otherwise, it returns False. The application should ensure that the method was successfully executed by checking the return value.

Example

Result = Mime.BodyB (Buffer, Bytes, 0)
If Result = False Then
MsgBox "Cannot create message with binary data", 64, "Sample Program"
End If

Back to Method Summary


1.4.5 Create

Summary

Create message.

Syntax

Boolean Create (Dest, To, From, Subject, Cc, Bcc, IsMime, IsNews)
  Dest String
  To String
  From String
  Subject String
  Cc String
  Bcc String
  IsMime Boolean
  IsNews Boolean

Description

To create a message, call the Create method with the parameters set as described below. The To parameter must be set to the mailing address (mail message) or the news group names (news article) of the recipients. The From parameter must be set to the mailing address of the sender. The Subject, Cc and Bcc parameters are optional and can be left as empty strings. The IsMime parameter specifies whether the message to be created is a MIME message (True or 1) or a non-MIME message (False or 0). The IsNews parameter specifies whether the message to be created is a mail message (False or 0) or a news article (True or 1). The Dest parameter must be set to the destination file name.

Please check the reference page of the individual properties for more information.

Plain messages can be plain text or uuencoded. MIME messages can be base64 encoded, quoted-printable encoded or plain text. The encoding is done by the MIME ActiveX control. For MIME messages, apart from the above the ContentId, ContentType, Subtype and Charset (optional) properties have to be set before creating the message. The MessageType property must be set for partial or external MIME messages.

The OnInformation, OnHeader and OnBody events will be fired to obtain the message header and body as well as any attachments. Once the header and body of the message is composed, the OnStatistics event is fired with the number of lines and number of bytes in the header and body of the message. For partial messages, the OnPartial event will be fired to obtain the part number and id and for external messages, the OnExternal event will be fired to obtain the access type and other pertaining information.

If an error occurs, then the OnError event will be fired. The application should set a flag in the OnError event, so that it can determine if the action was successful. In addition, the application may want to display an error message in the OnError event to inform the user of the error. Please check the reference page of the OnError event for a complete listing of error codes.

The Create method returns True if successful; otherwise, it returns False. Calling this method is equivalent to setting the Action property to ACTION_CREATE.

Example

Result = Mime.Create ("c:\temp\test", "test", "someone", "Testing", "", "", True, False)
If Result = True Then
MsgBox "Created message successfully", 64, "Sample Program"
End If

Back to Method Summary


1.4.6 External

Summary

External message.

Syntax

Boolean External ()

Description

If the application is creating an external message, then the External method can be used to set the MessageType property to MESSAGE_EXTERNAL. An external message is a MIME message whose ContentType is "message" and Subtype is "external-body". This is generally used to reference an external data source. The actual data is not included in the body part.

The OnExternal event will be fired to obtain the information for the external message. The OnExternal event will be fired only if the MessageType property is set to MESSAGE_EXTERNAL.

If the external message is part of a multipart message, then the External method is used to the MessageType property inside the OnHeader event for that attachment and then reset to MESSAGE_NONE immediately.

The External method returns True if successful; otherwise, it returns False. Calling this method is equivalent to setting the MessageType property to MESSAGE_EXTERNAL.

Example

Result = Mime.External ()

Back to Method Summary


1.4.7 Extract

Summary

Extract message.

Syntax

Boolean Extract (Src, Dest)
  Src String
  Dest String

Description

To extract a message, call the Extract method with the Src and Dest parameters set. The Src parameter must be set to source path and filename and Dest parameter must be set to the destination directory name.

The message header and body are extracted first and saved in the destination directory. The OnExtract event will be fired to inform the application about the filename, encoding type, content type, subtype and level. The FileName, Encoding, ContentType and Subtype properties will be set with the appropriate values before the OnExtract event is fired.

If there are any attachments, they will be extracted and the OnExtract event will contain the information. All encoded files will be decoded and then saved. For Partial messages, the OnExtract message will be fired only when all the parts of the message have been extracted and reassembled. An OnError event will occur to indicate only a part of the message has been extracted.

If an error occurs, then the OnError event will be fired. The application should set a flag in the OnError event, so that it can determine if the action was successful. In addition, the application may want to display an error message in the OnError event to inform the user of the error. Please check the reference page of the OnError event for a complete listing of error codes.

The Extract method returns True if successful; otherwise, it returns False. Calling this method is equivalent to setting the Action property to ACTION_EXTRACT.

Example

Result = Mime.Extract ("c:\temp\test.001", "c:\temp")
If Result = True Then
MsgBox "Extracted message successfully", 64, "Sample Program"
End If

Back to Method Summary


1.4.8 Partial

Summary

Partial message.

Syntax

Boolean Partial ()

Description

If the application is creating a partial message, then the Partial method can be used to set the MessageType property to MESSAGE_PARTIAL. A partial message is a MIME message whose ContentType is "message" and Subtype is "partial". This is generally used to send very large files in many parts. The various parts will be reassembled on the receiving end.

The OnPartial event will be fired to obtain the information for the partial message. The OnPartial event will be fired only if the MessageType property is set. A partial message cannot be a body part of a multipart message.

The Partial method returns True if successful; otherwise, it returns False. Calling this method is equivalent to setting the MessageType property to MESSAGE_PARTIAL.

Example

Result = Mime.Partial ()

Back to Method Summary


1.4.9 QuotedDecode

Summary

Decode a file using quoted-printable format.

Syntax

Boolean QuotedDecode (Src, Dest)
  Src String
  Dest String

Description

To decode a file using Quoted-Printable format, call the QuotedDecode method with the Src and Dest parameters set. The Src parameter must be set to source path and filename and Dest parameter must be set to the destination path and filename.

If an error occurs, then the OnError event will be fired. The application should set a flag in the OnError event, so that it can determine if the action was successful. In addition, the application may want to display an error message in the OnError event to inform the user of the error. Please check the reference page of the OnError event for a complete listing of error codes.

The QuotedDecode method returns True if successful; otherwise, it returns False. Calling this method is equivalent to setting the Action property to ACTION_QUOTED_DECODE.

Example

Result = Mime.QuotedDecode ("c:\temp\file.1", "c:\temp\file.2")
If Result = True Then
MsgBox "Decoded successfully", 64, "Sample Program"
Exit Sub
End If

Back to Method Summary


1.4.10 QuotedEncode

Summary

Encode a file using quoted-printable format.

Syntax

Boolean QuotedEncode (Src, Dest)
  Src String
  Dest String

Description

To encode a file using Quoted-Printable format, call the QuotedEncode method with the Src and Dest parameters set. The Src parameter must be set to source path and filename and Dest parameter must be set to the destination path and filename.

If an error occurs, then the OnError event will be fired. The application should set a flag in the OnError event, so that it can determine if the action was successful. In addition, the application may want to display an error message in the OnError event to inform the user of the error. Please check the reference page of the OnError event for a complete listing of error codes.

The QuotedEncode method returns True if successful; otherwise, it returns False. Calling this method is equivalent to setting the Action property to ACTION_QUOTED_ENCODE.

Example

Result = Mime.QuotedEncode ("c:\temp\file.1", "c:\temp\file.2")
If Result = True Then
MsgBox "Encoded successfully", 64, "Sample Program"
Exit Sub
End If

Back to Method Summary


1.4.11 UUdecode

Summary

UUdecode a file.

Syntax

Boolean UUdecode (Src, Dest)
  Src String
  Dest String

Description

To UUdecode a file, call the UUdecode method with the Src and Dest parameters set. The Src parameter must be set to source path and filename and Dest parameter must be set to the destination path and filename.

Once the file has been decoded, the FileName property will contain the name of the original file used during the UUencode process. The application may want to rename the decoded file to its original name.

If an error occurs, then the OnError event will be fired. The application should set a flag in the OnError event, so that it can determine if the action was successful. In addition, the application may want to display an error message in the OnError event to inform the user of the error. Please check the reference page of the OnError event for a complete listing of error codes.

The UUdecode method returns True if successful; otherwise, it returns False. Calling this method is equivalent to setting the Action property to ACTION_UUDECODE.

Example

Result = Mime.UUdecode ("c:\temp\file.1", "c:\temp\file.2")
If Result = True Then
MsgBox "Decoded successfully", 64, "Sample Program"
Exit Sub
End If

Back to Method Summary


1.4.12 UUencode

Summary

UUencode a file.

Syntax

Boolean UUencode (Src, Dest)
  Src String
  Dest String

Description

To UUencode a file, call the UUencode method with the Src and Dest parameters set. The Src parameter must be set to source path and filename and Dest parameter must be set to the destination path and filename. The FileName property must be set to the name that will be used during encoding. This is necessary to preserve the original name of the file during the decoding process at the receiving end. The number of lines in the encoded file is returned in the Lines property after the encoding.

If the Dest parameter is an empty string, then the encoded output is not generated but the Lines property will contain the number of lines in the encoded file. This information is necessary while building the header for a uuencoded message.

If an error occurs, then the OnError event will be fired. The application should set a flag in the OnError event, so that it can determine if the action was successful. In addition, the application may want to display an error message in the OnError event to inform the user of the error. Please check the reference page of the OnError event for a complete listing of error codes.

The UUencode method returns True if successful; otherwise, it returns False. Calling this method is equivalent to setting the Action property to ACTION_UUENCODE.

Example

Result = Mime.UUencode ("c:\temp\file.1", "c:\temp\file.2")
If Result = True Then
MsgBox "Encoded successfully", 64, "Sample Program"
Exit Sub
End If

Back to Method Summary