%
strId = request("ID")
strAdId = request("ADID")
' 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
' Create a recordset object to store specific table information
Set objAd = Server.CreateObject("ADODB.Recordset")
'Establish what records you want selected for the SQL query string
SQL = "Select * From Ads where Add_Id = " & strAdId
'Set the recordset object equal to the SQL query string
objAd.Open SQL, objADO, 1, 3
strSellerEmail = objrs("EmailAddress")
'Response.Write strSellerEmail
strName = request("txtName")
strPhone = request("txtPhone")
strEmail = request("txtEmail")
strMessage = request("txtMessage")
if Request.Form <> "" then
if strName = "" or strPhone = "" or strEmail = "" then
msg = "
Fields marked with an * are required."
end if
if strPhone <> "" and not isnumeric(strPhone) then
Msg = Msg + "
Phone # can only contain numbers."
end if
if strPhone <> "" and len(strPhone)<> "10" then
Msg = Msg + "
Phone # must contain 10 digits. Please include the area Code."
end if
'Checks for a valid email address
if strEmail <> "" and (instr( strEmail, "@") = 0 or instr( strEmail, ".") = 0) then
Msg = Msg + "
Email Address must be in the form account@server.com."
end if
if msg = "" then
strSubject = strWebsite & " Inquiry About Your Ad On " & strVarCompany
strBody = strBody + "INQUIRY ABOUT YOUR CLASSIFIED AD" & vbcrlf
strBody = strBody + strVarWebsite & "/cl_AdDetail.asp??ID=" & objad("cl_UserID") & vbcrlf
strBody = strBody + "Name: " & strName & vbcrlf
strBody = strBody + "Phone: " & strPhone & vbcrlf
strBody = strBody + "Email: " & strEmail & vbcrlf & vbcrlf
strBody = strBody + strMessage & vbcrlf &vbcrlf
strBody = strBody + "Please contact the interested party directly concerning your listing."
Set objNewMail = Server.CreateObject("CDONTS.NewMail")
objNewMail.From = strEmail
objNewMail.To = strSellerEmail
objNewMail.cc = strVarEmail
objNewMail.Subject = strSubject
objNewMail.BodyFormat = 0
objNewMail.MailFormat = 1
objNewMail.Body = strBody
objNewMail.Send()
Response.Redirect "sellercontacted.asp"
end if
end if
%>
<% if Msg <> "" then %>
| Message(s):<%= Msg %>
|
<% end if %>
|
|
Complete the form below to contact the seller regarding their listing.
Fields marked with an * are required.
|
|
|
|
|
|