How do I use CDONTS.new to send an email with attachment?

R

Ray Costanzo [MVP]

Is the problem with how to attach a file to a CDONTS message or how to
accept a file from that a user uploaded first? Is that the source of the
file? If so, you must first save the file to the file system on your server
and then use the .AttachFile method of the CDONTS.NewMail object.

For further help, please provide more details, like code, error messages,
etc.

Ray at home
 
J

Jeff Cochran

Can someone give me some sample code to use CDONTS.new to send email
with an attachment?

I've got sample code from the following website;

http://msdn.microsoft.com/library/e...newmail_object_cdonts_library_.asp?frame=true

But, I'm having trouble GETTING the relevant field from my HTML form!
I can't seem to be able to get the field property. :(
It just comes up as a blank.

This could be a problem with the form, your method of retrieving it or
the code you use.

First, stop using CDONTS and use CDO instead. See:

http://www.aspfaq.com/show.asp?id=2026

Second, are you able to send mail but not with an attachment, or not
send mail at all? Have you tried just sending messages with
attachments without pulling information from a form? You said the
field property comes up as a blank, have you tried a Response.Write to
see what is actually being processed by the form?

Post relevant code snippets for real help.

Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top