modified MailController.php