Added the ability to specify an environment for looking up the SMTP service.