Properly set the scope of the setupMail function