code for mail attachment

V

vinodkus

dear sir/madam
I m developing a program for mail attacment but i got an error
error '80004005'
/mail1.asp, line 24
. Please help me.
<%
Set newmail = server.CreateObject ("cdonts.newmail")
txtTo = request.form("txtTo")
txtFrom = request.form("txtFrom")
txtSub = request.form("txtSub")
file1 = request.form("file1") ''''''''''''''''''''''''''' error line
newmail.bodyformat = 0
newmail.mailformat = 0
newmail.from = txtFrom
newmail.to = txtTo
newmail.subject = txtSub

If file1 <> "" then
newmail.AttachFile(file1)
End If

newmail.body = "Dear Sir I am sending my mail"
newmail.send
Set newmail = Nothing

%>
Thanks in advance
 
M

Mike Brind

dear sir/madam
I m developing a program for mail attacment but i got an error
error '80004005'
/mail1.asp, line 24
. Please help me.
<%
Set newmail = server.CreateObject ("cdonts.newmail")
txtTo = request.form("txtTo")
txtFrom = request.form("txtFrom")
txtSub = request.form("txtSub")
file1 = request.form("file1") ''''''''''''''''''''''''''' error line
newmail.bodyformat = 0
newmail.mailformat = 0
newmail.from = txtFrom
newmail.to = txtTo
newmail.subject = txtSub

If file1 <> "" then
newmail.AttachFile(file1)
End If

newmail.body = "Dear Sir I am sending my mail"
newmail.send
Set newmail = Nothing

%>
Thanks in advance

You have a space in your variable name: file 1. That's not legal. Close
the space.

Also, CDONTS was deprecated about 7 years ago. You should be using CDO.

http://classicasp.aspfaq.com/email/how-do-i-send-e-mail-with-cdo.html
 

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,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top