add function for sendemail in globs.js