fixed environmental variables for email function