title: emailing scripts
body: <p>Trying to send mail with the following script, I substitute $1 with the email address I want to send the email to. </p>
  
  <pre><code>#!/bin/bash
  # script to send simple email
  # email subject
  SUBJECT="SET-EMAIL-SUBJECT"
  # Email To ?
  EMAIL="$1"
  # Email text/message
  EMAILMESSAGE="/tmp/emailmessage.txt"
  echo "This is an email message test"&gt; $EMAILMESSAGE
  echo "This is email text" &gt;&gt;$EMAILMESSAGE
  # send an email using /bin/mail
  mail -s "$SUBJECT" "$EMAIL" &lt; $EMAILMESSAGE
  </code></pre>
  
  <p>I have tried sending myself emails with this script, but I don't get anything. I also don't get an error which makes it more difficult to figure out what's wrong. Anyone know how to send an email through a script? 
  I'm on a macbook pro, and my operating system is Leopard.</p>
  
  <p>Ted.</p>