Updated the email send code.