Added all nedded functions for email service.