Results 1 to 3 of 3

Thread: ASP Error

  1. #1
    Join Date
    Jul 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default ASP Error

    I have IIS 6 and I am trying to make a form page for asp. The code it
    <%

    ' declare variables
    Dim EmailFrom
    Dim EmailTo
    Dim Subject
    Dim Name
    Dim Email
    Dim Pages
    Dim Pictures
    Dim EmailAccounts
    Dim eCommerce

    ' get posted data into variables
    EmailFrom = Trim(Request.Form("EmailFrom"))
    EmailTo = "Skikool12@hotmail.com"
    Subject = Trim(Request.Form("Subject"))
    Name = Trim(Request.Form("Name"))
    Email = Trim(Request.Form("Email"))
    Pages = Trim(Request.Form("Pages"))
    Pictures = Trim(Request.Form("Pictures"))
    EmailAccounts = Trim(Request.Form("EmailAccounts"))
    eCommerce = Trim(Request.Form("eCommerce"))


    ' prepare email body text
    Dim Body
    Body = Body & "Name: " & Name & VbCrLf
    Body = Body & "Email: " & Email & VbCrLf
    Body = Body & "Pages: " & Pages & VbCrLf
    Body = Body & "Pictures: " & Pictures & VbCrLf
    Body = Body & "EmailAccounts: " & EmailAccounts & VbCrLf
    Body = Body & "eCommerce: " & eCommerce & VbCrLf

    ' send email
    Dim mail
    Set mail = Server.CreateObject("CDO.Message")
    mail.To = EmailTo
    mail.From = EmailFrom
    mail.Subject = Subject
    mail.Body = Body
    mail.Send

    ' redirect to success page
    Response.Redirect("Thankyou.htm" & EmailFrom)
    %>

    and I get the error

    Microsoft VBScript runtime error '800a01b6'

    Object doesn't support this property or method: 'Body'

    /contact.asp, line 53

    Anyone know what I should do?
    Last edited by smartbuyweb; 07-13-2005 at 07:11 PM. Reason: spelling errors in code

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Code:
    mail.Body = Body
    ... should be:
    Code:
    mail.TextBody = Body
    Also (I don't know ASP, so I could be wrong here), I have a feeling that
    Code:
    Response.Redirect("Thankyou.htm" & EmailFrom)
    will give a 404 when the user is redirected to something like "Thankyou.htmuser@domain.com".
    I think it more likely that you mean to say
    Code:
    Response.Redirect("Thankyou.htm&" & EmailFrom)
    to pass EmailFrom as a GET variable.
    Last edited by Twey; 07-14-2005 at 06:14 PM.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jul 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I looked over it again after I posted this. I changed the text.body thing and it works great so thanks anyway.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •