<!--- 
  Filename: PersonnelMail1.cfm
  Author:   Nate Weiss (NMW)
  Purpose:  A simple form for sending email
--->


<HTML>
<HEAD>
  <TITLE>Personnel Office Mailer</TITLE>
  <!--- Apply simple CSS formatting to <TH> cells --->
  <STYLE>
    TH {background:blue;color:white;text-align:right}
  </STYLE>
</HEAD>
<BODY>

<H2>Personnel Office Mailer</H2>

<!--- If the user is submitting the Form... --->
<CFIF IsDefined("FORM.Subject")>

<!--- We do not want ColdFusion to suppress whitespace here --->
<CFPROCESSINGDIRECTIVE SUPPRESSWHITESPACE="No">
  
<!--- Send the mail message, based on form input --->
<CFMAIL
  SUBJECT="#FORM.Subject#"
  FROM="personnel@orangewhipstudios.com"
  TO="#FORM.ToAddress#"
  BCC="personneldirector@orangewhipstudios.com"
>This is a message from the Personnel Office:
#FORM.MessageBody#

If you have any questions about this message, please
write back or call us at extension 352.  Thanks!</CFMAIL>

</CFPROCESSINGDIRECTIVE>
  
  <!--- Display "success" message to user --->
  <P>The email message was sent.<BR>
  By the way, you look fabulous today. 
  You should be in pictures!<BR>

<!--- Otherwise, display the form to user... --->  
<CFELSE>
  <!--- Provide simple form for recipient and message --->
  <CFFORM ACTION="#CGI.SCRIPT_NAME#" METHOD="POST">
    
    <TABLE CELLPADDING="2" CELLSPACING="2">
      <!--- Table row: Input for Email Address --->
      <TR>
        <TH>EMail Address:</TH>
        <TD>
          <CFINPUT 
            TYPE="Text" 
            NAME="ToAddress"
            REQUIRED="Yes"
            SIZE="40"
            MESSAGE="You must provide an email address.">
        </TD>
      </TR>
    
      <!--- Table row: Input for E-mail Subject --->
      <TR>
        <TH>Subject:</TH>
        <TD>
          <CFINPUT 
            TYPE="Text" 
            NAME="Subject"
            REQUIRED="Yes"
            SIZE="40"
            MESSAGE="You must provide a subject for the email.">
        </TD>
      </TR>

      <!--- Table row: Input for actual Message Text --->
      <TR>
        <TH>Your Message:</TH>
        <TD>
          <TEXTAREA
            NAME="MessageBody"
            COLS="30"
            ROWS="5"
            WRAP="Hard"></TEXTAREA>
           
        </TD>
      </TR>

      <!--- Table row: Submit button to send message --->
      <TR>
        <TD></TD>
        <TD>
          <INPUT
            TYPE="Submit"
            VALUE="Send Message Now">
        </TD>
      </TR>
    </TABLE>
  </CFFORM>
</CFIF>  

</BODY>
</HTML>
