|
<%
Dim src_name, src_email, dest_email, dest_name, str_message
Dim src_send, str_Error, esc_page, src_page,escPage
Dim strSafety
const defaultSite = "http://www.marriages.org"
const siteName = "Marriage Encounter and Engaged Encounter"
const abuseAccount = "webmaster@marriages.org"
const footer = "Take a step in building a stronger marriage today!"
str_Error = ""
src_page = request.form("p")
src_name = request.form("src_name")
src_email = request.form("src_email")
dest_name = request.form("dest_name")
dest_email = request.form("dest_email")
str_message = request.form("str_message")
src_send = request.form("src_send")
if request.queryString("p")<>"" then
src_page = request.queryString("p")
end if
Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
if objFSO.FileExists(server.mappath(src_page)) Then
src_page = defaultSite & "/" & src_page
else
src_page = defaultSite
end if
escPage = server.urlEncode(src_page)
Dim objMail, strTo, strBody,nl
nl = chr(13) & chr(10)
if (request.form("p")<>"") then
if src_name<>"" and src_email<>"" and dest_email<>"" and dest_name<>"" then
strSafety = nl & "This message was sent to you on behalf of " & src_name & ". "
strSafety = strSafety & " If you do not know"& " " & src_name
strSafety = strSafety & " please ignore this message or report it to"
strSafety = strSafety & " " & abuseAccount & "."
set objMail = CreateObject("CDONTS.NewMail")
objMail.from = src_email
objMail.To = dest_email
if (src_send<>"") then objMail.cc = src_email
objMail.subject = siteName & " Recommendation"
strBody = dest_name & "," & nl & nl
if str_Message<>"" then
strBody = strBody & src_Name & "(" & src_Email & ") says: "
strBody = strBody & nl & nl & str_message & nl & nl
end if
strBody = strBody & src_Name & " also suggests you take a look at "
strBody = strBody & nl & src_Page & " on " & siteName & "." & nl & nl
strBody = strBody & strSafety & nl
strBody = strBody & footer
objmail.body = strBody
objMail.send
set objMail=nothing
response.write(" We sent your recommendation!")
else
str_Error = " You did not fill out all required fields."
end if
end if
if (request.form("p")="" or str_Error<>"") then
%>
<%=str_Error%>
<%
end if
%>
|