Added email logging