Added email logging.