In order to provide a nicer reading experience of transmitted contents - try replacing /r/n or /n with <br /> while parsing the given contents. It's unclear whether htmlspecialchars filters out line breaks by default.