change to use global variables and use remote smtp server instead of local