Microsoft VBScript runtime error '800a01b6'

Discussion in 'Classic ASP' started by tsqrcocom00, May 17, 2009.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Microsoft VBScript runtime error '800a01a8'

    I get this error when trying ASPEmail - any idea how to solve this?

    Microsoft VBScript runtime error '800a01a8'
    Object required: 'Session(...)'
    /emailform/SendMail.asp, line 9


    here is the code excerpt:


    LINE 1: <OBJECT RUNAT=SERVER PROGID="Persits.MailSender" ID="Mail">

    </OBJECT>



    <%

    LINE 9: Set arrTo = Session("arrTo")

    Set arrCc = Session("arrCC")

    Set arrBcc = Session("arrBcc")

    Set arrFiles = Session("arrFiles")
     
  2. Hi,
    The error code is telling you that you have not defined the session you are setting.
    Did you find some code that you're trying to get working or do you have a handle on this?
    Salute,
    Mark
     
  3. I fixed it.

    I get this error :

    Microsoft VBScript runtime error '800a01b6'
    Object doesn't support this property or method: 'Mail'
    /emailform/SendMail.asp, line 6


    when I run the sample code form ASPEmail. See code snapshot below where the error starts.

    Line1:<OBJECT RUNAT=SERVER PROGID="Persits.MailSender" ID="Mail">
    Line2:</OBJECT>
    Line3:
    Line4: <%
    Line5:
    Line6: Set Mail = Server.CreateObject("Persits.MailSender")
    Set arrTo = Session("arrTo")
    Set arrCc = Session("arrCC")
    Set arrBcc = Session("arrBcc")
    Set arrFiles = Session("arrFiles")

    ' Handle "Send Message" button
    Mail.Host = "smtp.tsqrco.com" ' replace it with your own SMTP server address
    If Request("SEND") <> "" Then

    ' get addresses from collections
    Items = arrTo.Items
    For i = 0 to arrTo.Count - 1
    Mail.AddAddress Items(i)
    Next
    Items = arrCc.Items
    For i = 0 to arrCc.Count - 1
    Mail.AddCc Items(i)
    Next
    Items = arrBcc.Items
    For i = 0 to arrBcc.Count - 1
    Mail.AddBcc Items(i)
    Next
    Items = arrFiles.Items
    For i = 0 to arrFiles.Count - 1
    Mail.AddAttachment Items(i)
    Next



    Mail.From = "[email protected]"
    Mail.FromName = "AspEmail Live Demo"
    Mail.Subject = Request("Subject")
    Mail.Body = Request("Body")
    ErrStr = ""
    Line 41: If Request("Signature") <> "" Then
     
  4. Microsoft VBScript runtime error '800a01a8'

    this is the ASPemail sample code I downloaded from:

    http://support.persits.com/email/email.zip

    to see if it would work on your server - I did not make any changes to the code. you can test it your self and let me know.
     
  5. Hi,
    I'll test it for you later today...
    I do have an IIS6 test server with DASP for this sort of thing and have used that component on it successfully, but I'll test again later today to make sure. ;-)
    Salute,
    Mark
     
  6. thank you
     
  7. Hi,
    The code below works, just change the Email address and name. (Line 7)
    (Save this code between BEGIN and END to a file named contact.asp)
    Salute,
    Mark

    --BEGIN----------------------------

    <%
    strHost = "localhost"
    If Request("Send") <> "" Then
    Set Mail = Server.CreateObject("Persits.MailSender")
    Mail.Host = strHost
    Mail.From = Request("From")
    Mail.FromName = Request("FromName")
    Mail.AddAddress "[email protected]", "Name"
    Mail.Subject = "Contact page"
    Mail.Body = Request("Body")
    strErr = ""
    bSuccess = False
    On Error Resume Next
    Mail.Send
    If Err <> 0 Then
    strErr = Err.Description
    else
    bSuccess = True
    End If
    End If
    %>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head><title>Contact</title></head>
    <body bgcolor="#FFFFFF">
    <% If strErr <> "" Then %>
    <h3>Error occurred: <% = strErr %></h3>
    <% End If %>
    <% If bSuccess Then %>
    <center><b>Success!</b> Message sent.</center>
    <% End If %>
    <form method="post" action="contact.asp">
    <center>
    <table cellspacing="0" cellpadding="2" width="550" bgcolor="#E0E0E0">
    <tr>
    <td>&nbsp;</td>
    <td align="center"><b>Contact form</b></td>
    </tr>
    <tr>
    <td>Your Email:</td>
    <td><input type="text" name="From" size="50" maxlength="50" /></td>
    </tr>
    <tr>
    <td>Your Name:</td>
    <td><input type="text" name="FromName" size="50" maxlength="50" /></td>
    </tr>
    <tr>
    <td>Message:</td>
    <td><textarea name="Body" cols="40" rows="10"></textarea></td>
    </tr>
    <tr>
    <td colspan="2" align="center"><input type="submit" name="Send" value="Send Message" /></td>
    </tr>
    </table>
    </center>
    </form>
    </body>
    </html>

    --END----------------------------
     
  8. that's great but how about the ASPUpload part? part of the original code from ASPemail I liked because it was a form which included a file upload as well.
     
  9. Hi,
    I have a backup of some of my old ASP code where I was using the Upload components with the mail object. I'll dig it up later and post it here.
    By the way. . .Are you opposed to using some of the newer technologies for this?
    It's difficult for many of us to test Classic ASP code anymore, as for myself I don't have any of my old IDEs installed any longer so any ASP code I post has to be tested live. ;-)
    Salute,
    Mark
     
  10. that would be great. the problem is all of the code we use is ASP. I am sure when we are ready hopefully sooner than later will be making the transition to ASP.net
     
  11. Hello Mark,

    any idea when you will have the chance to help me with the ASPupload as part of the form you made? thanks so much for your help.
     
  12. Hi,
    I need at leat one more day to dig this up, I'm serving Honor Guard duties this week at Mountain Home for one of the U.S. Soldiers who recently died.
    Salute,
    Mark
     
  13. that's more important. no worries and get back to me when you have time.
     
  14. Hi,
    I've attached the code. (fileup.zip)
    As is it is the working code I was using on an IIS6 DASP server a few years ago.
    All you have to do is add the obvious settings in-place of the bogus settings I put in. i.e. Mail server, Email, Folder location, etc.
    Salute,
    Mark
     

    Attached Files:

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page