code for mail attachment

Discussion in 'ASP General' started by vinodkus@gmail.com, Sep 19, 2007.

  1. Guest

    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, 2007
    #1
    1. Advertising

  2. Mike Brind Guest

    <> wrote in message
    news:...
    > 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

    --
    Mike Brind
    Mike Brind, Sep 19, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    492
    Paul Lesnikowski
    Nov 10, 2005
  2. Bertus Dam
    Replies:
    0
    Views:
    438
    Bertus Dam
    Aug 26, 2003
  3. Chris Welch
    Replies:
    1
    Views:
    315
    S. Justin Gengo
    Nov 25, 2003
  4. Cantekin Guneser

    sending mail with attachment

    Cantekin Guneser, Apr 18, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    296
    John Timney \(ASP.NET MVP\)
    Apr 18, 2004
  5. tma

    Mail Attachment problem

    tma, Jul 30, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    399
Loading...

Share This Page