Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Object doesn't support this property or method: 'MyCDONTSMail.AttachFi 1

Status
Not open for further replies.

jcroft

Programmer
Aug 23, 2001
52
US
Would someone be kind enough to look at this mess and tell me what I am doing wrong?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<INPUT type=file name=notify action=&quot;filetransfer.asp&quot;>
<INPUT id=submit type=submit value=&quot;Send to All&quot; name=&quot;submit&quot;>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Microsoft VBScript runtime error '800a01b6'

Object doesn't support this property or method: 'MyCDONTSMail.AttachFile'

/managementemail/filetransfer.asp, line 49

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Set MyCDONTSMail = server.CreateObject(&quot;CDONTS.NewMail&quot;)
MyCDONTSMail.MailFormat = cdoMailFormatMIME
MyCDONTSMail.From = &quot;someone@somewhere.com&quot;
MyCDONTSMail.To= &quot;everyone@somewhere.com&quot; 'email
MyCDONTSMail.Subject= Request.Form(&quot;Subject&quot;)
MyCDONTSMail.BodyFormat = cdoBodyFormatHTML
MyBody = &quot;To: &quot; & rs(&quot;fname&quot;) & &quot; &quot; & rs(&quot;lname&quot;) & &quot;<br><BR>&quot;
MyBody = MyBody & &quot;From: &quot; & &quot;Someone Else&quot; & &quot;<br><BR>&quot;
MyBody = MyBody & body & &quot;<br><BR>&quot;
MyCDONTSMail.Body= MyBody

MyCDONTSMail.AttachFile= request.form(&quot;filePath&quot;)

MyCDONTSMail.Send
set MyCDONTSMail=nothing
--only those that do not try, fail--
 
you need to upload the file to the server before you can access it with CDONTS to attach to the email, and you need to specify &quot;enctype=&quot;multipart/form-data&quot;&quot; in your form tag for it to support inputting the file.

then you would call the form input fields by whatever your file upload object name is, say for example if you're using SAFileUp:

Set oUpload = Server.CreateObject(&quot;SoftArtisans.FileUp&quot;)

Then you would refer to the form data as:

oUpload.Form(&quot;fieldname&quot;)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top