updated config to read from env variables
server now returns json from sendMail