adds and configures all email functionality