<%
dim site, strsmtp, ShowAction
site = Request.ServerVariables("SERVER_NAME")
'This allows you to test on your local system and move to your host server 'and not have to change the smtp everytime
'if site = "localhost" then
'strsmtp = "127.0.0.1"
'elseif site = "www.belmamaandcherub.com" then
strsmtp = "mail.belmamaandcherub.com"
'end if
ShowAction = Request.QueryString("action")
Select Case ShowAction
Case ""
%>
<%
Case "send"
if request.form("email") <> "" then
'sets variables
dim name, email, sendmail
email = request.form("email")
name = request.form("name")
'Create the e-mail server object
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")
' Outgoing SMTP server
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strsmtp
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objCDOSYSCon.Fields.Update
'send a specific page or send a site url
dim url
'url = Request.ServerVariables("HTTP_REFERER")
url = "http://www.belmamaandcherub.com/"
'Update the CDOSYS Configuration
Set objCDOSYSMail.Configuration = objCDOSYSCon
objCDOSYSMail.From = "tellafriend@belmamaandcherub.com"
objCDOSYSMail.To = email
objCDOSYSMail.Subject = "Check out this website - http://www.belmamaandcherub.com/"
objCDOSYSMail.HTMLBODY = "Site recommendation from " & name & "!
" & _
vbCrlf & vbCrlf & name & " has sent you a link to check out The Shower Hug, a Mom’s Essential for Breast Pain Relief during Pregnancy and Breastfeeding. Happy reading… " & _
vbCrlf & "The SHOWER HUG by Belmama & Cherub at " & _
vbCrlf & url & vbCrlf & _
vbCrlf & "
" & _
vbCrlf & "Thank you, " & _
vbCrlf & "customercare@belmamaandcherub.com" & vbCrlf
objCDOSYSMail.Send
'Close the server mail object
Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing
response.redirect "http://www.belmamaandcherub.com/thank_you3.html"
else
response.redirect Request.ServerVariables("HTTP_REFERER")
end if
end select
%>

|