<% @ language="vbscript" %> <% Response.Buffer = True %> <% ' Easy refer script! ' Courtesy of SamHS, a member of the dotdragnet team ' Tailored to work like Burt's php script ' This version copyright dotdragnet.co.uk ' Please let us know if you make any enhancements to this ' script - so we can offer them to our users. ' You can set your own variables here: ' Insert your site name for use in the email sitename="www.taxonline.com.my" ' Insert your message for the email - either including your web site address, ' Or leaving the & sitename at the end of the string ' newly added line for including user messages 'if messagebody ="" then message="I found this great tax computation program. It may be useful in your firm. Take a look at this site: " & sitename 'else ' message =messagebody & sitename 'end if ' message="Hi there, take a look at this great site that I found: " & sitename ' Insert the location of the thank you page for users thankspage="http://www.taxonline.com.my/thankyou.htm" ' ********************************** ' DO NOT CHANGE BELOW THIS LINE ' ********************************** Dim strTo, strSubject, strBody Dim objCDOMail 'First we'll read in the values entered email = Request.Form("email") email2 = Request.Form("email2") email3 = Request.Form("email3") sendername = Request.Form("sendername") senderemail = Request.Form("senderemail") message=Request.form("messagebody") if message ="" then message="I found this great tax computation program. It may be useful in your firm. Take a look at this site: " & sitename 'else 'message =messagebody & sitename end if alreadysent=0 send2 = 1 send3 = 1 If email3 = "" Or Not IsValidEmail(email3) Then send3=0 End If If email2 = "" Or Not IsValidEmail(email2) Then send2=0 End If If (senderemail = "" Or Not IsValidEmail(senderemail)) Or (email="" Or Not IsValidEmail(email)) Then Response.Write("I'm sorry - you didn't enter a valid email address for yourself and/or the recipient, please go back and correct the address!") Else strSubject = "A message from your friend, " & sendername strBody = message If send3=1 And Send2=1 Then sendemail(email) sendemail(email2) sendemail(email3) Response.Redirect thankspage End If If send3=0 And Send2=1 Then sendemail(email) sendemail(email2) Response.Redirect thankspage End If If send3=0 And Send2=0 Then sendemail(email) Response.Redirect thankspage End If Response.Write(send2 & send3) End If %> <% ' Functions follow ' Send the email Function sendemail(stremail) Set objCDOMail = Server.CreateObject("CDONTS.NewMail") objCDOMail.From = Request("senderemail") objCDOMail.To = stremail objCDOMail.Subject = strSubject objCDOMail.Body = strBody objCDOMail.Send Set objCDOMail = Nothing End Function ' Is it a valid email address being used? Function IsValidEmail(strEmail) Dim bIsValid bIsValid = True If Len(strEmail) < 5 Then bIsValid = False Else If Instr(1, strEmail, " ") <> 0 Then bIsValid = False Else If InStr(1, strEmail, "@", 1) < 2 Then bIsValid = False Else If InStrRev(strEmail, ".") < InStr(1, strEmail, "@", 1) + 2 Then bIsValid = False End If End If End If End If IsValidEmail = bIsValid End Function %>