writing emails to error log for testing