Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

asp form email failure after migrating site

  • 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