Properly set the scope of the setupMail function

When passing password from configuration, the scope of the setupMail function was wrong causing this.mail call on line 33 to crash.