As per RFC 821 (the SMTP protocol), line endings should always be \r\n () in mail headers and content, but in practice it shouldn't matter as most mail servers handle all three type of line endings correctly (supposedly, some old UNIX-based ones actually choke on \r\n but not \n).