Forums
This topic is locked
Sending Form to Email using ASP
Posted 22 Dec 2007 15:21:25
1
has voted
22 Dec 2007 15:21:25 James Chan posted:
here is my scriptit seems as though it works (it redirects to the "Thanks" page) however when i check my meail, i recieve nothing
<%
' declare variables
Dim EmailFrom
Dim EmailTo
Dim Subject
Dim FirstName
Dim LastName
Dim month
Dim day
Dim year
Dim email
' get posted data into variables
EmailFrom = Trim(Request.Form("email")
EmailTo = " "
Subject = "Every Internet Game Guestlist"
fname = Trim(Request.Form("fname")
lname = Trim(Request.Form("lname")
month = Trim(Request.Form("month")
day = Trim(Request.Form("day")
year = Trim(Request.Form("year")
email = Trim(Request.Form("email")
' prepare email body text
Dim Body
Body = Body & "fname: " & fname & VbCrLf
Body = Body & "lname: " & lname & VbCrLf
Body = Body & "month: " & month & VbCrLf
Body = Body & "day: " & day & VbCrLf
Body = Body & "year: " & year & VbCrLf
Body = Body & "email: " & email & VbCrLf
' send email
Dim mail
Set mail = Server.CreateObject("CDONTS.NewMail"
mail.To = EmailTo
mail.From = EmailFrom
mail.Subject = Subject
mail.Body = Body
mail.Send
' redirect to success page
Response.Redirect("Thanks.html?" & EmailFrom)
%>