<% 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 strYourName = request("txtYourName") strYourEmail = request("txtYourEmail") strFriendsName = request("txtFriendsName") strFriendsEmail = request("txtFriendsEmail") strComments = request("txtComments") 'Response.Write strId if Request.Form <> "" 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 & " Band Listing sent from " & strYourName strBody = strBody + "Hi " & strFriendsName & "," & vbcrlf & vbcrlf strBody = strBody + strYourName & " thought you may be interested in the band listing link below:" & vbcrlf strBody = strBody + strVarWebsite + "/banddetail.asp?ID=" & strId & 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 %>
<% if Msg <> "" then %> <% end if %>
Message(s):<%= Msg %>

  Email A Friend


Fields marked with an * are required.

Friend's Name: *
Friend's Email: *
Your Name: *
Your Email: *
Comments: