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!

CDONTS Attachment problem 1

Status
Not open for further replies.

webspy

Programmer
Aug 3, 2001
79
IN
hi experts,
i am using cdonts object to send mails to our registered users.everthing is working good.but now we want to put a page in our site to send the viewers contribution as attachment to my email id.

here is my code
*******************************8
pfrom="pto="raghuram23@hotmail.com"
psubject=Request.Form("subject")
attach= Request.Form("files")
pbody=Request.Form("body")
dim objCDO
dim sendhtml
dim reshtml
set objCDO =server.CreateObject("CDONTS.NewMail")
objCDO.To=pto
objCDO.From=pfrom
objCDO.Subject=psubject
objCDO.BodyFormat = 0
objCDO.MailFormat = 1
objCDO.Body=pbody
if len(attach)>0 then
objCDO.AttachFile attach
end if
objCDO.send
set objCDO=nothing
***************************

but it shows error on line objCDO.AttachFile. If i remove that line it works fine.

i need to gave option to send attachments.
please help me to solve this problem

thanx
with regards
webspy
 
Are you doing any checking to see if Request.Form("files") is a valid path ie the files are there?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top