title: here-document gives 'unexpected end of file' error
body: <p>I need my script to send an email from terminal. Based on what I've seen here and many other places online, I formatted it like this:</p>
  
  <pre class="lang-none prettyprint-override"><code>/var/mail -s "$SUBJECT" "$EMAIL" &lt;&lt; EOF
  Here's a line of my message!
  And here's another line!
  Last line of the message here!
  EOF
  </code></pre>
  
  <p>However, when I run this I get this warning:</p>
  
  <pre><code>myfile.sh: line x: warning: here-document at line y delimited by end-of-file (wanted 'EOF')
  
  myfile.sh: line x+1: syntax error: unexpected end of file
  </code></pre>
  
  <p>...where line x is the last written line of code in the program, and line y is the line with <code>/var/mail</code> in it. I've tried replacing <code>EOF</code> with other things (<code>ENDOFMESSAGE</code>, <code>FINISH</code>, etc.) but to no avail. Nearly everything I've found online has it done this way, and I'm really new at bash so I'm having a hard time figuring it out on my own. Could anyone offer any help?</p>