log errors when sending emails