%
strUserName = session("UserName")
strAccessLevel = session("AccessLevel")
strAction = request("cmdAction")
strYourName = request("txtYourName")
strYourEmail = request("txtYourEmail")
strFriendsName = request("txtFriendsName")
strFriendsEmail = request("txtFriendsEmail")
strComments = request("txtComments")
'displays message if coming from another script page.
Msg = request("Message")
strId = request("Id")
' Create a recordset object to store specific table information
Set objRS = Server.CreateObject("ADODB.Recordset")
'Establish what records you want selected for the SQL query string
SQL = "Select * From TblLogin where LoginId =" & strId
'Set the recordset object equal to the SQL query string
objRS.Open SQL, objADO, 1, 3
if Request.Form <> "" and strAction <> "" then
if strYourName = "" or strYourEmail = "" or strFriendsName = "" or strFriendsEmail = "" then
msg = "Fields marked with an * are required."
end if
'Checks for a valid email address
if strYourEmail <> "" and (instr( strYourEmail, "@") = 0 or instr( strYourEmail, ".") = 0) then
Msg = Msg + "
Your Email Address must be in the form account@server.com."
end if
if strFriendsEmail <> "" and (instr( strFriendsEmail, "@") = 0 or instr( strFriendsEmail, ".") = 0) then
Msg = Msg + "
Friend's Email Address must be in the form account@server.com."
end if
if msg = "" then
strSubject = strVarWebsite & " Show Listing sent from " & strYourName
strBody = strBody + "Hi " & strFriendsName & "," & vbcrlf & vbcrlf
strBody = strBody + strYourName & " thought you may be interested in the show listing link below:" & vbcrlf
strBody = strBody + strVarWebsite + "/detail.asp?ID=" & lid & vbcrlf
strBody = strBody + "Additional Comments: " & strComments & vbcrlf &vbcrlf
strBody = strBody + "You can contact your friend directly about the listing at " & strYourEmail & vbcrlf & vbcrlf
strBody = strBody + "Thank you for your interest in " & strVarWebsite
Set objNewMail = Server.CreateObject("CDONTS.NewMail")
objNewMail.From = strVarEmail
objNewMail.To = strFriendsEmail
'objNewMail.cc = strVarEmail
objNewMail.Subject = strSubject
objNewMail.BodyFormat = 1
'objNewMail.MailFormat = 1
objNewMail.Body = strBody
objNewMail.Send()
Msg = strFriendsName & " has been sent your email regarding this listing."
end if
end if
%>