Corrected a bug in sendEmail() caught by Taar.