472,101 Members | 1,436 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,101 software developers and data experts.

code for mail attachment

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

Sep 19 '07 #1
1 1876

<vi******@gmail.comwrote in message
news:11*********************@57g2000hsv.googlegrou ps.com...
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/h...-with-cdo.html

--
Mike Brind
Sep 19 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by joealey2003 | last post: by
reply views Thread by Chris McKeever | last post: by
reply views Thread by imre.adam | last post: by
11 posts views Thread by ColinWard | last post: by
1 post views Thread by theWizard1 | last post: by
9 posts views Thread by deepaks85 | last post: by
2 posts views Thread by Ruud | last post: by
1 post views Thread by rengaraj | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.