Added SMTP settings and moved call to sendEnrollmentEmail to server.