Hi,
I have written an e-mail script and tested using response.write to confirm that the values were past to it from the form, and they were. It redirects to the thank-your page even without sending an error message, but the e-mail never sends. Do you know what I have done wrong?
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Dim varFName, varLName, varPhone, varEmail, varQuery, varFrom, varSubject, varTo, varRedirect
varFName=Request.Form("FirstName")
varLName=Request.Form("LastName")
varPhone=Request.Form("Telephone")
varEmail=Request.Form("Email")
varQuery=Request.Form("Query")
varFrom=Request.Form("from")
varSubject=Request.Form("subject")
varTo=Request.Form("to")
varRedirect=Request.Form("redirect")
Dim ObjMail
Set ObjMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = varFrom
objMail.To = varTo
objMail.Subject = varSubject
objMail.Body = "First Name: " & varFName & ""_
& VBCrLf & VBCrLf & "Last Name: " & varLName & ""_
& VBCrLf & VBCrLf & "Phone: " & varPhone & ""_
& VBCrLf & VBCrLf & "Email: " & varEmail & ""_
& VBCrLf & VBCrLf & "Query: " & varQuery & ""
objMail.Send
Set objMail = Nothing
Response.Redirect(varRedirect)
%>
Thanks.
shaunacg
I have written an e-mail script and tested using response.write to confirm that the values were past to it from the form, and they were. It redirects to the thank-your page even without sending an error message, but the e-mail never sends. Do you know what I have done wrong?
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Dim varFName, varLName, varPhone, varEmail, varQuery, varFrom, varSubject, varTo, varRedirect
varFName=Request.Form("FirstName")
varLName=Request.Form("LastName")
varPhone=Request.Form("Telephone")
varEmail=Request.Form("Email")
varQuery=Request.Form("Query")
varFrom=Request.Form("from")
varSubject=Request.Form("subject")
varTo=Request.Form("to")
varRedirect=Request.Form("redirect")
Dim ObjMail
Set ObjMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = varFrom
objMail.To = varTo
objMail.Subject = varSubject
objMail.Body = "First Name: " & varFName & ""_
& VBCrLf & VBCrLf & "Last Name: " & varLName & ""_
& VBCrLf & VBCrLf & "Phone: " & varPhone & ""_
& VBCrLf & VBCrLf & "Email: " & varEmail & ""_
& VBCrLf & VBCrLf & "Query: " & varQuery & ""
objMail.Send
Set objMail = Nothing
Response.Redirect(varRedirect)
%>
Thanks.
shaunacg