Added mail sending functionality.