Added the email sending to the backend.