send an email and print to log on error