CDONTS - no attachments

J

Jason Steeves

I am using cdonts to send mail messages with an attachment. The problem I am
having is the messages are going through OK but the attachments are not
there. Any ideas? I have tried my code elsewhere and it looks
OK...........Jason
 
J

Jason Steeves

It gets the attachment from a field, within the web form, that the user can
browse to the required file. I believe the files that the users need to
attach are on their individual computers. If I put
(trim(Request.Form("attachedfile"))) inplace for the subject it does return
the valid path to the file along with the file name ie: c:\jason.txt.

Thanks for any help you can provide............Jason

dim MailObj
set MailObj = Server.CreateObject("CDONTS.NewMail")
MailObj.To = "(e-mail address removed)"
MailObj.From = trim(Request.Form("txtOriginatorMailID"))
MailObj.AttachFile (trim(Request.Form("attachedfile")))
MailObj.Subject = "sending"
MailObj.Body = rstreg
MailObj.BodyFormat = 0
MailObj.MailFormat = 0
MailObj.Send
set MailObj = nothing
 
C

Curt_C [MVP]

first off, the files for attachment have to be on the server, the cdonts (you
really should use CDO and not CDONTS also) is on the server, and it doesnt
have access to files on the client.

Secondly, try hardcoding one of the server files as the attachment file and
test.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
 
B

Bullschmidt

And here is a pure ASP (i.e. no components) resource for letting the
user upload a file which is something that was unfortunately not built
into ASP:

ASP File Upload Using VBScript by John R. Lewis - 7/10/2000
http://aspzone.com/articles/160.aspx

The above free code has worked well for me and you can copy and paste
the code sample which is white on gray (what were they thinking?) or
just highlight it and it becomes black on white.

Best regards,
J. Paul Schmidt, Freelance Web and Database Developer
http://www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top