Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

test asp form pages to email

Status
Not open for further replies.

janet24

Technical User
Jul 22, 2003
161
US
I'm trying to test an asp form that is sent to an email. Without having a hosting server, is there any other place I could test a file like this?
 
You could set up PWS or IIS on your local machine depending on your OS

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
It doesn't work with sending an asp email form.
 
This is my code. It seems to load but it doesn't redirect to the thanks page. Can anybody help me?


<% @LANGUAGE = VBScript %>
<% Option Explicit %>
<%

' name attribute of submit button
If Request.Form("Submit")<>"" then

Dim strName, strEmail, strQuery
strName = Trim(Request.Form("Last_name"))
strEmail = Trim(Request.Form("Email"))

strQuery = "" &_
"First Name - " & Request.Form("ClientName") & VbCrlf &_
"Last Name - " & Request.Form("Last_name") & VbCrlf &_
"Address - " & Request.Form("ClientAddress") & VbCrlf &_
"City - " & Request.Form("ClientCity") & VbCrlf &_
"State - " & Request.Form("ClientState") & VbCrlf &_
"Zip - " & Request.Form("ClientZip") & VbCrlf &_
"Email - " & Request.Form("Email") & VbCrlf &_
"Phone Number - " & Request.Form("ClientPhone") & VbCrlf &_
"Number of Children - " & Request.Form("ClientChildren") & VbCrlf &_


'response.write(strQuery & "<br>")
'response.end

if (strName <> "" And strEmail <> "") Then
on error resume next ' disable Error Handler

Dim objMail
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = "info@tuitionsolution.com"
objMail.To = "phil@betabenefits.com"
objMail.Subject = "Your Inquiry " & strName
objMail.Body = strQuery
objMail.Send
Set objMail = Nothing

if err.number<>0 then
response.write(err.description)
end if
on error GOTO 0 ' restore to default behavior(HALT)

Response.Redirect("thanks.htm")
end if

Else ' FORM SUBMIT
<% end if %>
 
What OS are you running? What CDO version are you running? You reference CDONTS - many servers will now be running CDO, so you may need to update your email code.

A quick search on this forum for 'CDO' will bring up several examples

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
no it's not that. I think it's something simple but I'm not an asp coder so I can't find it.
 
Any chance you could explain HOW it doesn't work? Errors you might be getting, etc.
 
It loads but it you just see a blank page and it's not redirecting to the thanks page.
 
For starters, I'd have to guess that Request.Form("Submit") = "" and therefore not executing your email code.

Is there anything below the
Code:
Else  'FORM SUBMIT
<% end if %>

 
Yes, he added and <% end if %> at the end but it still doesn't work and the guy who uploads the form gave me a hit that it was something simple. I don't know asp code so it's not simple for me.
 
Did you see my stab at it though? That the form variable "Submit" [ Request.Form("Submit") ] is blank and therefore not executing the email code?
 
That sounds like it. I must of cut off the end of the form. Thanks so much. It shows you how much I know.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top