469,331 Members | 1,769 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,331 developers. It's quick & easy.

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 1845

<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
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Purva khokhar | last post: by
1 post views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.