Minor fix to detect if we are sending emails from an appspot domain - then the sender email must be changed to appspotmail.
Also made some minor modifications to the build settings to work correctly with my local environment.