Make sending e-mail more robust

- Use pipes instead of temporary files to pass the content to sendmail
- Use comma as a delimiter for 'To:' addresses per RFC2822
- exec-like functions expect the first argument to be the name of the program
- Provide multiple addresses to sendmail in separate arguments
- Update the unit test to write to a temp file so it can check the content