The AttachFile method adds an attachment to the message by reading a file.
objNewMail.AttachFile(Source [, FileName] [, EncodingMethod] )
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.