Export (0) Print
Expand All

AttachFile Method (CDONTS NewMail Object)

Exchange Server 2003

Topic Last Modified: 2004-06-09

The AttachFile method adds an attachment to the message by reading a file.


        objNewMail.AttachFile(Source [, FileName] [, EncodingMethod] ) 

objNewMail

Required. This NewMail object.

Source

Required. IStream object or String. The full path and file name of the file to be attached to the message, or a pointer to an IStream object containing the file data.

FileName

Optional. String. The file name to appear in the attachment's placeholder in the message. If FileName is not supplied, the file name from the Source parameter is used.

EncodingMethod

Optional. Long. The manner of encoding the attachment. The following values are possible:

EncodingMethod setting

Value

Description

CdoEncodingUUencode

0

The attachment is to be in UUEncode format (default).

CdoEncodingBase64

1

The attachment is to be in base 64 format.

The default value for the EncodingMethod parameter can change if you set the MailFormat property. If MailFormat is set to CdoMailFormatText, the default value is CdoEncodingUUencode. If MailFormat is set to CdoMailFormatMime, the default value is CdoEncodingBase64. However, if you add an attachment encoded in base 64 format, the value of the MailFormat property is automatically set to CdoMailFormatMime.

Only C/C++ and Java programs can use an IStream object for the Source parameter. They should pass an IUnknown object that returns an IStream interface in response to QueryInterface. Microsoft® Visual Basic® supports the IDispatch interface and not IUnknown, so it cannot use an IStream object.

Show:
© 2014 Microsoft