The best way is to ask the mail server administrator to create an account for the app and use that. Thats also the safest, I cannot understand why you want to accept the risks that come with anounymous email sending.
But if you insist…
You could try to create a page and your own microflow that retrieves the settings and replace username and password with empties and save it. You might need to remove the before commit event handler that does the encryption of the password…