OUR SERVICES
 
Bin Ham Petroleum Group
Bin Ham Drilling
Bin Ham General Contracting
Bin Ham Trading For Building Materials
Al- Hur Contracting And General Maintenance
Bin Ham Electro- Mechanical Ent Co. L.L.C
Bin Ham Agricultural Company
City Seasons Group Of Hotels
 
Bin Ham General Trading
Bin Ham Travel And Tourism L.L.C
Bin Ham Properties
Bin Ham Enterprises General Trading
Al Sharq Alawsat For Printing And Publishing
Heliozayed Oce’ Photocopying LLC
International Forex L.L.C.
Bin Ham Enterprises
Educational Establishments
Sultan Bakeries & Markets
Society Service
 
 
TELL A FRIEND
 
 
<% Dim objCDONTS ' Email object Dim strFromName ' From persons' real name Dim strFromEmail, strToEmail ' Email addresses Dim strSubject, strBody ' Message Dim strThisPage ' This page's URL Dim strReferringPage ' The referring page's URL Dim bValidInput ' A boolean indicating valid parameters ' Retrieve this page name and referring page name strThisPage = Request.ServerVariables("SCRIPT_NAME") strReferringPage = Request.ServerVariables("HTTP_REFERER") ' Debugging lines: 'Response.Write strThisPage & "
" & vbCrLf 'Response.Write strReferringPage & "
" & vbCrLf ' Read in and set the initial values of our message parameters strFromName = Trim(Request.Form("txtFromName")) strFromEmail = Trim(Request.Form("txtFromEmail")) strToEmail = Trim(Request.Form("txtToEmail")) strSubject = "Have a look at this web site www.BinHamGroup.com" strBody = Trim(Request.Form("txtMessage")) ' I set the body message to a message that referenced the page the ' user arrived from. This makes it great if you place a link to it ' from your different articles, but can be weird if people link in ' from other web sites. If strBody = "" Then If strReferringPage = "" Or InStr(1, strReferringPage, "www.BinHamGroup.com", 1) = 0 Then strBody = "" strBody = strBody & "I have visited Bin Ham Group site, I thought you might be interested in what they have to offer." & vbCrLf strBody = strBody & vbCrLf strBody = strBody & "www.BinHamGroup.com" & vbCrLf strBody = strBody & "Bin Ham Group" & vbCrLf strBody = strBody & vbCrLf strBody = strBody & "Abu Dhabi," & vbCrLf strBody = strBody & "P.O.Box: 45580," & vbCrLf strBody = strBody & "Abu Dhabi, United Arab Emirates." & vbCrLf strBody = strBody & "Phone: 00971-2-6784000" & vbCrLf strBody = strBody & "Fax: 00971-2-6784111" & vbCrLf strBody = strBody & vbCrLf strBody = strBody & "Al Ain" & vbCrLf strBody = strBody & "P.O.Box: 15155," & vbCrLf strBody = strBody & "Al Ain, United Arab Emirates." & vbCrLf strBody = strBody & "Phone: 00971-3-7545171" & vbCrLf strBody = strBody & "Fax: 00971-3-7546088" & vbCrLf strBody = strBody & vbCrLf strBody = strBody & "Dubai" & vbCrLf strBody = strBody & "P.O.Box: 33155," & vbCrLf strBody = strBody & "Dubai, United Arab Emirates." & vbCrLf strBody = strBody & "Phone: 00971-4-2957671" & vbCrLf strBody = strBody & "Fax: 00971-4-2958804" & vbCrLf strBody = strBody & "Email: info@BinHamGroup.com" & vbCrLf Else strBody = "" strBody = strBody & "I have visited Bin Ham Group site, I thought you might be interested in what they have to offer." & vbCrLf strBody = strBody & vbCrLf strBody = strBody & "www.BinHamGroup.com" & vbCrLf strBody = strBody & "Bin Ham Group" & vbCrLf strBody = strBody & vbCrLf strBody = strBody & "Abu Dhabi," & vbCrLf strBody = strBody & "P.O.Box: 45580," & vbCrLf strBody = strBody & "Abu Dhabi, United Arab Emirates." & vbCrLf strBody = strBody & "Phone: 00971-2-6784000" & vbCrLf strBody = strBody & "Fax: 00971-2-6784111" & vbCrLf strBody = strBody & vbCrLf strBody = strBody & "Al Ain" & vbCrLf strBody = strBody & "P.O.Box: 15155," & vbCrLf strBody = strBody & "Al Ain, United Arab Emirates." & vbCrLf strBody = strBody & "Phone: 00971-3-7545171" & vbCrLf strBody = strBody & "Fax: 00971-3-7546088" & vbCrLf strBody = strBody & vbCrLf strBody = strBody & "Dubai" & vbCrLf strBody = strBody & "P.O.Box: 33155," & vbCrLf strBody = strBody & "Dubai, United Arab Emirates." & vbCrLf strBody = strBody & "Phone: 00971-4-2957671" & vbCrLf strBody = strBody & "Fax: 00971-4-2958804" & vbCrLf strBody = strBody & "Email: info@BinHamGroup.com" & vbCrLf End If End If ' Quick validation just to make sure our parameters are somewhat valid bValidInput = True bValidInput = bValidInput And strFromName <> "" bValidInput = bValidInput And IsValidEmail(strFromEmail) bValidInput = bValidInput And IsValidEmail(strToEmail) ' If valid send email and show thanks, o/w show form If bValidInput Then ' Set up our email object and send the message Set objCDONTS = Server.CreateObject("CDONTS.NewMail") objCDONTS.From = strFromName & " <" & strFromEmail & ">" objCDONTS.To = strToEmail objCDONTS.Subject = strSubject objCDONTS.Body = strBody objCDONTS.Send Set objCDONTS = Nothing ' Show our thank you message ShowThanksMsg Else If "http://" & Request.ServerVariables("HTTP_HOST") & strThisPage = strReferringPage Then Response.Write "There's been an error. Please check your entries:" & "
" & vbCrLf End If ' Show our information retrieval form ShowReferralForm strThisPage, strFromName, strFromEmail, strToEmail, strBody End If ' End of page logic... subs and functions follow! %> <% ' Subroutines and Functions that encapsulate some functionality ' and make the above code easier to write... and read. ' A quick email syntax checker. It's not perfect, ' but it's quick and easy and will catch most of ' the bad addresses than people type in. 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 ' I made this a function just to get it out of the ' logic and make it easier to read. It just shows the ' form that asks for the input Sub ShowReferralForm(strPageName, strFromName, strFromEmail, strToEmail, strBody) ' I use script_name so users can rename this script witout having to change the code. %>
Your Name:
Your Email:
Friends Email:
Message:
  
<% '

The Message to be sent:

'

Subject: < %= strSubject % >

'

Body: < %= strBody % >

End Sub ' This just shows our thank you message... probably didn't need to ' be a function, but since I made the form one I figured I'd do this ' for consistency. Sub ShowThanksMsg() %>

Dear <%= strFromName %>, Thank you for recommending our website.

 

 

Sincerely,
Bin Ham Group

 

<% End Sub %>
 
 

Home   l   About Us   l   Feedback   l   Tell a Friend   l   Contact Us

Designed & Developed by:
eeWebSolutions.com

Copyright © 2007 Bin Ham Group, All Rights Reserved.