Fix invalid email headers

Issue report in http://issues.thebuggenie.com/thebuggenie/issues/2389
Merge pull request #281 from Oleh-Kravchenko/master

Fix invalid email headers