I have written a script that writes a message to a text file and also sends it as an email. Everything goes well, except the email finally appears to be all in one line. >
Setting the content-type header to Content-Type: text/plain (with \r\n at the end) allowed me to send multi-line plain-text emails.
Content-Type: text/plain
\r\n