Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

asp form email failure after migrating site

Options
  • 02-12-2008 12:14pm
    #1
    Closed Accounts Posts: 975 ✭✭✭


    I'm a PHP coder, and know little about asp. I migrated an ASP site for someone recently and all is working but the email form. The original form was using (email addresses replaced with fakes)

    [php]
    Set myMail = CreateObject("CDONTS.NewMail")
    myMail.From = "x@y.z"
    myMail.To = "a@b.c"
    myMail.Subject = "Contact form from " & fullname
    myMail.Body = msg
    myMail.Send
    [/php]

    I was getting a HTTP Error 500 - Internal server error which I traced to the myMail.Send line. Looking here
    http://www.tizag.com/aspTutorial/aspFormsEmail.php
    it seems that the above is deprecated so I tried the following stub

    [php]
    <%
    Option Explicit
    Dim objNewMail
    Set objNewMail = Server.CreateObject("CDO.Message")
    objNewMail.From = "a@b.c"
    objNewMail.To = "x@y.z"
    objNewMail.Subject = "This is a test Mail"
    objNewMail.TextBody = "This is the Body text of this test mail."
    objNewMail.Send()
    Set objNewMail = Nothing
    Response.Write "Email has been sent"
    %>
    [/php]

    Again the send() function causes a HTTP Error 500 - Internal server error.

    The hosting provider is reputable, so I doubt thats the issue. I would appreciate any advice on possible cause, or on how to get a more meaningful error message displayed.


Advertisement