SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Addict
    Join Date
    Jun 2008
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ASP email form configuration - help please!

    Hi All,

    I'm hoping for a little help please! I have a client who asked me to take over a couple of existing sites for them the bulk of which is built directly as html so is nice and straight forward. However there are couple of forms on each site using asp which i have no experience of being a php guy.

    I'm in the process of transferring the sites over to the hosting i provide with the idea of getting them up and running on domain references prior to transferring the domains etc.

    All is now up and running except the forms which i was optismitacally hoping may just work straight out the box!

    When i've gone to test the forms and hit submit i receive the following error:

    HTTP 500.100 - Internal Server Error - ASP error

    Error Type:
    Server object, ASP 0177 (0x800401F3)
    System message, messageid = 0x800401f3
    /priestthorpehall.co.uk/book.asp, line 16
    Apache/2
    This is the code which is powering the form:

    Code ASP:
    <%
    Function SendMail(MailTo, Subject, Body, MailFrom)
    	Dim oMail
     
    	Set oMail = Server.CreateObject("CDO.Message") 
    	Set oMailConfig = Server.CreateObject ("CDO.Configuration") 
     
    	oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.XXXXXXXXXXXX.co.uk"  ' Specify SMTP Server
    	oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 
    	oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
    	oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 500 
        oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
        oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
        oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "XXXXXXXXXXXX" 
        oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "XXXXXXXXXXX" 
    	oMailConfig.Fields.Update 
     
    	Set oMail.Configuration = oMailConfig 
    	oMail.From = MailFrom			' Specify sender's name
    	oMail.To   = MailTo
    	oMail.Subject = Subject
    	oMail.HTMLBody = Body
     
    	oMail.Send
    	Set oMail = Nothing	 	
    	Set oMailConfig = Nothing
    End Function
    %>
          <%
        Dim varName, varPosition, varCompany, varAddress, varPhone, varEmail
        Dim varCarHire, varCarBuy, varRinkHire, varRinkBuy, varSyntheticHire, varSyntheticBuy
     
    	varName = Request.Form("Name")
    	varEmail = Request.Form("Email")
    	varTel = Request.Form("Tel")
    	varView = Request.Form("View")
    	varMessage = Request.Form("Message")
     
     
    	Dim varBody	
    	varBody = "linda@XXXXXXXXXXXX.co.uk"
    	varBody = "<html><body>" & vbCrLf
    	varBody = varBody & "<table cellPadding='2' border='2' style='FONT-SIZE: 12px;'>"
    	varBody = varBody & "<tr><td style='PADDING-LEFT: 5px; FONT-WEIGHT: bold; FONT-SIZE: 12px; VERTICAL-ALIGN: middle; WIDTH: 400px; COLOR: navy; HEIGHT: 20px; BACKGROUND-COLOR: #e3edf6' colSpan='3'>priestthorpe Hall viewing enquiry</td></td>"
    	varBody = varBody & "<tr><td width=140><B>Name</b></td><td colspan='2'>" & varName & "</td></tr>"
    	varBody = varBody & "<tr><td><B>Email</b></td><td colspan='2'>" & varEmail & "</td></tr>"
    	varBody = varBody & "<tr><td><B>Tel</b></td><td colspan='2'>" & varTel & "</td></tr>"
    	varBody = varBody & "<tr><td><B>View</b></td><td colspan='2'>" & varView & "</td></tr>"
    	varBody = varBody & "<tr><td><B>Message</b></td><td colspan='2'>" & varMessage & "</td></tr>"
     
     
     
    	varBody = varBody & "</table>"
    	varBody = varBody & "</body></html>"
     
    	Call SendMail("anoldemail@address.com", "priestthorpe Hall viewing enquiry", varBody, "anoldemail@address.com")
     
        On Error Resume Next
            If Err <> 0 Then 
                Response.Write "An error occurred: " & Err.Description 
            else
    %>

    I'm currently trying to send the test emails to an old email address i have for testing purposes, a couple of things sprung to mind as to why i have a problem but without knowing asp i'm just guessing really so any help would be appreciated!

    1st thought - problem is occuring because site is residing on a domain reference, however as i haven't changed any of the smtp settings i'd have thought the email would still be sent via the existing mail server which currently works in the live environment?

    2nd thought - its trying to send the email via the email server associated with the hosting i have provided so i therefore created a mirror email address and settings on the new hosting but this hasn't solved the problem.

    Many Thanks for taking the time to read this and hopefully offer your advice!

    James

    ps. i've XXX'd out email addresses etc. hopefully this won't cause people a problem in helping resolve my issue?

  2. #2
    SitePoint Addict
    Join Date
    Jun 2008
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just had another thought...

    i'm trying to set these asp forms up on lunix hosting platform - is asp supported on lunix or should i be using a windows platform?

  3. #3
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,629
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    ASP is Windows-only. You'll either need to use Windows hosting, or convert the ASP to PHP. (Which shouldn't be too difficult - emailing via PHP is pretty easy. Look at SwiftMailer or PHPMailer classes).
    Ian Anderson
    www.siteguru.co.uk

  4. #4
    SitePoint Addict
    Join Date
    Jun 2008
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Ian,

    i'm now trying to get the site up and running on a windows platform - my resellers account allows me to provide both lunix and windows hosting.

    i've got everything uploaded and have tested the form but i now get the following error.


    500 - Internal server error.
    There is a problem with the resource you are looking for, and it cannot be displayed.
    The file it is looking for is book.asp which is in the root directory (and appears to process the email submission - the code 1st posted is taken from the book.asp file).

    I haven't done anything other than upload all the files exactly as they were downloaded from current live environment - do i need to do any server config with asp? As i say its my 1st exposure to asp.

    Any suggestions?

  5. #5
    SitePoint Guru
    Join Date
    Jun 2007
    Posts
    689
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    turn off friendly error messages so the problem code can be identified

  6. #6
    SitePoint Addict
    Join Date
    Jun 2008
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks webber... if i knew how to turn them off i would! never touched asp before so i can just about fugure out what is generally happening but a little unstuck on the specifics!

    I've got the 1st form working for the 1st site so will applying the same logic to the remaining parts tomorrow.

  7. #7
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,629
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Friendly error messages are a setting in Internet Explorer.

    However it could just as easily be the IIS (web server) setup.
    Ian Anderson
    www.siteguru.co.uk


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
  •