Add functions for email server