<% '############SET ALL VARIABLES################' Dim FirstName, LastName, Email, FriendsEmail, Custom, Age, BirthDay, Error, Msg, ErrorMsg, sConnection, objConn , objRS, MysqlStatement, Friend_Array Function IsBlank(ByRef TempVar) IsBlank = False Select Case VarType(TempVar) Case 0, 1 IsBlank = True Case 8 If Len(TempVar) = 0 Then IsBlank = True End If Case 9 tmpType = TypeName(TempVar) If (tmpType = "Nothing") Or (tmpType = "Empty") Then IsBlank = True End If Case 8192, 8204, 8209 If UBound(TempVar) = -1 Then IsBlank = True End If End Select End Function if Request.Form("submit")="Tell Your Friends" Then FirstName = Request.Form("FirstName") LastName = Request.Form("LastName") Email = Request.Form("Email") FriendsEmail = Request.Form("FriendsEmail") Custom = Request.Form("Custom") Age = Request.Form("Age") BirthDay = Request.Form("BirthDay") ErrorMsg="Please provide:
" If IsBlank(FirstName) then Error="true" ErrorMsg=ErrorMsg & "Your First Name
" End If If IsBlank(LastName) then Error="true" ErrorMsg=ErrorMsg & "Your Last Name
" End If If IsBlank(Email) then Error="true" ErrorMsg=ErrorMsg & "Your Email
" End If If IsBlank(FriendsEmail) then Error="true" ErrorMsg=ErrorMsg & "Your Friend's Email
" End If If Not IsBlank(Age) or Not IsBlank(BirthDay) then Error="true" End If If IsBlank(Error) then '#########Put Emails in the database###########' sConnection = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=h41mysql11.secureserver.net; DATABASE=TellAFriendWBL; UID=TellAFriendWBL;PASSWORD=AaW!!24131; OPTION=3" Set objConn = Server.CreateObject("ADODB.Connection") objConn.Open(sConnection) '###########Insert the Referrer#####################' MysqlStatement="INSERT INTO emails (email, first_name, last_name, referrer, referred, date_added) VALUES('"&Email&"', '"&FirstName&"', '"&LastName&"', 'YES', 'NO', CURDATE())" Set objRS = objConn.Execute(MysqlStatement) '###################Get the mail body from the db####################' Set EmailobjRS = objConn.Execute("SELECT email_text FROM email_text WHERE email_text_id='1'") Do While Not EmailobjRS.EOF EmailText=EmailobjRS.Fields("email_text") EmailobjRS.MoveNext Loop Friend_Array=split(FriendsEmail,",") For Each friend In Friend_Array friend = Trim(friend) MysqlStatement="INSERT INTO emails (email, referrer, referred, referred_by, date_added) VALUES('"&friend&"', 'NO', 'YES', '"&FirstName&" "&LastName&"', CURDATE())" Set objRS = objConn.Execute(MysqlStatement) '############replace all the placeholders###########' EmailBodyMsg=Replace(EmailText, "", Chr(13)) EmailBodyMsg=Replace(EmailBodyMsg, "", Email) EmailBodyMsg=Replace(EmailBodyMsg, "", FirstName) EmailBodyMsg=Replace(EmailBodyMsg, "", LastName) EmailBodyMsg=Replace(EmailBodyMsg, "", friend) EmailBodyMsg=Replace(EmailBodyMsg, "", "Http://www.wealthybaglady.com") EmailBodyMsg=Replace(EmailBodyMsg, "", Custom) '###########Email the friends#####################' Set Mail=Server.CreateObject("CDONTS.NewMail") Mail.To=friend Mail.From=Email '"invitation@wealthybaglady.com"' Mail.Subject=FirstName&" "&LastName&" recommended Wealthy Bag Lady" Mail.Body=EmailBodyMsg Mail.Send Set Mail=nothing Next '#########Close Connection and empty all objects and variable, send back a message of success###########' Set objRS = Nothing objConn.Close Msg="Your friends have been notified. Thank you for the referral. Click here to download your free copy of the Wealthy Bag Lady Ultimate Resource Guide." FirstName=empty LastName=empty Email=empty FriendsEmail=empty Custom=empty Age=empty BirthDay=empty Error=empty ErrorMsg=empty sConnection=empty MysqlStatement=empty Friend_Array=empty End If End If %> Wealthy Bag Lady - Tell A Friend

Tell A Friend

And Get Your Free Copy of the Wealthy Bag Lady Ultimate Resource Guide

As a way of saying thank you for your referrals, we would like to offer you a free copy of the Wealthy Bag Lady Ultimate Resource Guide (33 pages), a $200 value for absolutely free. Just fill out the following information, and after submitting, we will give you a link to this great resource.

<% If Not Msg="" or Not Msg=null Then response.write("
"& Msg &"
") ElseIf Not Error="" or Not Error=null Then response.write("
" & ErrorMsg & "
") Else response.write("
Please fill out all required information (*).
") End If %>







Separate emails with a comma (,).