Corrected email functionality