So i found the solution. For yahoo at least but should work the same for other email app.
the reason the mail app is not able to setup is because your mail account probably has 2FA setup. You can use your regular username and password to setup.
Go to your yahoo account > account and security and choose app password. Generate a password for the app your trying to logon for example outlook or mail app. Use this password to setup your mail app and it everything works.