Link to home
Start Free TrialLog in
Avatar of akbiro
akbiroFlag for United States of America

asked on

.asp form

I am working on a simple form for my son's wedding rsvp.  The page is www.birowedding.com/yespage.html.

When you click the submit button it goes to the .asp page instead of executing that page.  I think I missed something in my the code.  can someone take a look and let me know?  THANKS
Avatar of Big Monty
Big Monty
Flag of United States of America image

looking at the code briefly, the form is posting it's data to contactusprocess.asp. Is it supposed to go somewhere else?
You have asp code in an HTML page - unless you have added HTML mapping to the server to be processed by the ASP engine it will just spew it out to the browser
Change the extension to .asp

yespage.asp
Your frame is a bit wrong   <frame src="http://www.loadup2us.com/tswedding//yespage.html" frameborder="0" />
 

Just one slash

  <frame src="http://www.loadup2us.com/tswedding/yespage.html" frameborder="0" />

However, you have to turn classic asp on.  Are you on a windows server?

http://www.iis.net/learn/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/classic-asp-not-installed-by-default-on-iis
You're on Bluehost with an Apache web server that will not run ASP code.  Either change to a Windows server or change your processing page.  

And why frames in frames?  There is nothing there that will benefit from the use of frames.
Avatar of akbiro

ASKER

Ok...I moved it to a different server.  Take a look from this link please and tell me why I can not process the form.  Thanks


http://www.xtremeaquaticfoods.com/tswedding/yespage.asp
It's falling in line 31, can you posteoporosis that line of code? Almost looks like a permissions issue
When I click on the file name "contactusprocess.asp" , I get this in response:
<font face="Arial" size=2>
<p>Server object</font> <font face="Arial" size=2>error 'ASP 0177 : 800401f3'</font>
<p>
<font face="Arial" size=2>Server.CreateObject Failed</font>
<p>
<font face="Arial" size=2>/tswedding/contactusprocess.asp</font><font face="Arial" size=2>, line 31</font>
<p>
<font face="Arial" size=2>800401f3
</font> 

Open in new window

At least now it is on a Microsoft IIS server where it can run.  There is just something wrong in the code.
You're on a newer version of IIS which doesn't have CDONTS, instead you use CDO.SYS
Just a minor change from what you already have, example here
http://www.w3schools.com/asp/asp_send_email.asp

p.s.
nice catch by Dave!
posteoporosis ???
Avatar of akbiro

ASKER

I changes it to CDO.SYS  no joy
Meant to say post, damn auto correct :)

Is line 31 a reference to the cdo object?
Avatar of akbiro

ASKER

I have no clue.  Sorry...I am just a beginner
Can you post like 31 then?
Avatar of akbiro

ASKER

Sorry, not sure what you are asking me to do.  Is there a correction for line 31.  Can you tell me what is should be?  THANKS
Avatar of akbiro

ASKER

Here is the code starting from line 31

Set objNewMail = Server.CreateObject("CDO.SYS.NewMail")
    objNewMail.From = Request("Email Address")
    objNewMail.Subject = "RSVP BiroWedding.com"
    objNewMail.To = mail_to
    objNewMail.Body = emsg & fline
    objNewMail.Send
    Set objNewMail = Nothing
Set objNewMail = Server.CreateObject("CDO.Message")

Open in new window

change

Set objNewMail = Server.CreateObject("CDO.SYS.NewMail")

to

Set objNewMail = Server.CreateObject("CDO.Message")
Avatar of akbiro

ASKER

Making progress?

Here is the new error message:

Microsoft VBScript runtime error '800a01b6'

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

/tswedding/contactusprocess.asp, line 35
Change it to

ObjNewMail.TextBody
. Our if you're sending out an html formatted email

ObjNewMail.HTMLBody
Follow the link I gave exactly
Avatar of akbiro

ASKER

This is what I have and it still fails.

Set objNewMail = Server.CreateObject("CDO.Message")
change your code to:

Set objNewMail = Server.CreateObject("CDO.SYS.NewMail")
    objNewMail.From = Request("Email Address")
    objNewMail.Subject = "RSVP BiroWedding.com"
    objNewMail.To = mail_to
    objNewMail.TextBody = emsg & fline      '-- for a text based email, otherwise use objNewMail.HTMLBody = emsg&fline
    objNewMail.Send
    Set objNewMail = Nothing
Avatar of akbiro

ASKER

I feel like an idiot...am I doing what you are suggesting...it still fails.  Thanks for your patience.
Post all your code as you have it now.
Avatar of akbiro

ASKER

<%
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Freeware from Seiretto.com
' available at http://asp.thedemosite.co.uk
'
' DON'T forget to change the mail_to email address below!!!
'    and thats all you need to change.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim error
error = 0
For Each f In Request.Form
If Request.Form(f) = "" Then
error = 1
End If
Next
If error=1 Then
response.redirect "error.html"
Else
Dim f, emsg, mail_to, r, o, c, other
mail_to = "akbiro@aol.com"
fline = "_______________________________________________________________________"& vbNewLine
hline = vbNewLine & "_____________________________________"& vbNewLine
emsg = ""

For Each f In Request.Form
If mid(f,1,1)<>"S" = True Then 'do not save if input name starts with S
emsg = emsg & f & " = " & Trim(Request.Form(f)) & hline
End If
Next

Set objNewMail = Server.CreateObject("CDO.SYS.NewMail")
    objNewMail.From = Request("Email Address")
    objNewMail.Subject = "RSVP BiroWedding.com"
    objNewMail.To = mail_to
    objNewMail.TextBody = emsg & fline      '-- for a text based email, otherwise use objNewMail.HTMLBody = emsg&fline
    objNewMail.Send
    Set objNewMail = Nothing

response.redirect "thankyou.html"
End if
%>
ASKER CERTIFIED SOLUTION
Avatar of Gary
Gary
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Change

Set objNewMail = Server.CreateObject("CDO.SYS.NewMail")

To

Set objNewMail = Server.CreateObject("CDO.Message")
Avatar of akbiro

ASKER

Thank you for your patience.  It works PERFECTLY...THanks and thanks again