Email sending fixes