updated stingEmail function, passing true or false to main code