<% Dim MODE, MSG, FE, FN, YN, MESSAGE, EXT, DONE MODE = Request.Form("mode") IF MODE = "send" THEN With Request FE = Trim(.Form("ToAddress")) FN = Trim(.Form("toname")) YN = Trim(.Form("FromName")) End With '------' Call CHECK_INP() IF MESSAGE = "" THEN '// GET EMAIL EXTENTION EXT = APO(Trim(Mid(FE,InStrRev(FE,".")+1,Len(FE)))) '// CHECK FOR DISALLOWED EXTENTIONS SQL = "SELECT ID FROM taf_tbl_ext WHERE fldEXT = '" & Lcase(EXT) & "' AND fldENABLE = 1" Call OPEN_DB() Set RS = Server.CreateObject("ADODB.Recordset") RS.Open SQL, MyConn IF NOT RS.EOF THEN MESSAGE = MESSAGE & "
  • Sorry, this email address has a disallowed extension (" & EXT & ")." Call ADD_LOG_LIN("Disallowed Extension: " & EXT, False) END IF RS.Close Set RS = Nothing '------------------' MSG = RETURN_MESSAGE(False) MSG = Replace(MSG,"%F_NAME%", FN) MSG = Replace(MSG,"%Y_N%", YN) '------------------' MyConn.Close Set MyConn = Nothing '------------------' IF MESSAGE = "" THEN '// WE ARE OK TO SEND THE EMAIL Call SEND_EMAIL_OUT(MSG, "Message from: " & YN, FE, SYS_EMAIL) Call ADD_LOG_LIN("Email has been sent. Extension:" & EXT, True) DONE = True END IF ELSE MSG = RETURN_MESSAGE(True) END IF ELSE MSG = RETURN_MESSAGE(True) MSG = Replace(MSG,"%F_NAME%","Colleague's Name") MSG = Replace(MSG,"%Y_N%","Your Name") END IF PRIVATE SUB CHECK_INP() IF (FE = "") OR (IsNull(FE)) THEN MESSAGE = MESSAGE & "
  • Please enter colleague's email address." IF (FN = "") OR (IsNull(FN)) THEN MESSAGE = MESSAGE & "
  • Please enter colleague's name." IF (YN = "") OR (IsNull(YN)) THEN MESSAGE = MESSAGE & "
  • Please enter your name." IF IsEmailValid(FE) = False THEN MESSAGE = MESSAGE & "
  • Please enter valid email address." END SUB %> Brian Babcock business consultant coach operations management consulting strategic planning

     

     
    Would you like to tell a colleague about our site ?
    Just fill out this form, press the submit button, and they will be sent a message letting them know about the article you just read.
    <% IF NOT MESSAGE = "" THEN %>
    <%= MESSAGE %><% END IF %> <% IF DONE = True THEN %>
    Thank You <%= YN %>,

    The message to <%= FN %> has been successfully sent.
    Would you like to send another one ?<% END IF %>


    Your colleague's email address:
    25<% Else%>18<%End If%>" maxlength="50" />
    Your colleague's name:
    25<% Else%>18<%End If%>" maxlength="50" />
    Your name:
    25<% Else%>18<%End If%>" maxlength="50" />


    Message that will be sent to your colleague:
    <%=replace(MSG,vbcrlf,"
    ")%>

       We do not store any information entered here.