Fixes to sending mail