Added changes to send emails on form submission.