You should pass in either one string that is the path and filename, or a
textstream object for an open file
AttachFile Method (CDONTS NewMail Object)
The AttachFile method adds an attachment to the message by reading a file.
objNewMail.AttachFile(Source [, FileName] [, EncodingMethod] )
Required. This NewMail object.
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.
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.
Optional. Long. The manner of encoding the attachment. The following values
EncodingMethod setting Value Description
CdoEncodingUUencode 0 The attachment is to be in UUEncode format
CdoEncodingBase64 1 The attachment is to be in base 64 format.
From: Hugh McLaughlin [mailto:hugh@k...]
Sent: 01 November 2001 21:48
To: Code Clinic
Subject: [proasp_codeclinic] Problems with mail attachments
Hello Everyone and thanks for your help in advance. I am developing an
application which uses CDONTS.NEWMAIL to send emails. My problem is that
when I try the following code to attach a file:
objCDOMail.AttachFile strFilePath , strFileName
I get the error:
I have used this code in the past, so I am not sure why it is not
working. Any help would be greatly appreciated. Thanks.