title: PHP's mail(): What are potential issues to watch out for?
body: <p>Given a contact form that accepts custom user input (e.g. address, subject line, message), what are some security implications and "gotchas" to be careful of?</p>
  
  <p>At a minimum, the user's email address will have to be validated (likely using filter_var() or equivalent). From what I've read, this should also prevent additional headers from being injected into the script.</p>
  
  <p>What about the subject line and message content though? Is any sanitation required for those fields? I figure an email client would prevent things like scripts from running automatically, and I'm not particularly worried about things like HTML tags (if someone wants to spend the time to style an email by hand, that's their prerogative - I just won't be seeing it :P). If sanitation <em>is</em> required, what's the best way of doing it without being too intrusive (i.e. keeping the nature of the email the same)?</p>