Fixing sendEmail function broken by a bad merge.