Improve formatting of mail logging

Casting the message to a string means the mail is logged with each line broken at 78 characters, with a `=` showing where the linebreaks happen. I assume this is how emails are formatted when sent to a mail server, but clearly for logging purposes it's no good. Unfortunately there is no way to cast to a string without this behaviour, so we have to do it manually.