uses environment to setup mail params