If this is the same problem I had, there is an easy fix. DO NOT delete your account until you try this… you will lose all of
your saved emails (including sent and trash). Instead, just fix your existing preferences (explained below).
Symptom: Apple Mail application suddenly does not recognize your Yahoo log in username or password that you know is correct, and it will not download or send mail from your Mac. OR it claims there is a server error and to try again later, leaving your account offline. This could be due to an issue between Yahoo and “third-party apps”.
Solution: Create a temporary (disposable) password with Yahoo and add it to the Mail preferences. You only need to do this once because “Mail” doesn’t ask you for this information again… it just stores and uses it.
(If you don’t want to follow my instructions below, you can find the yahoo help info at https://help.yahoo.com/kb/generate-third-party-passwords-sln15241.html)
Sign in to your online Yahoo email page and then go to your account security page:
Hover your cursor over your name in the upper right hand area and select “Account Info”. Then select “Account Security” (you may have to sign in to Yahoo again -- https://login.yahoo.com/account/security.) Select “Generate app password or Manage app passwords”. Select “Mac Mail” (or other 3rd party app in trouble) and click on “Generate.”
Now, COPY the temporary password (that is disposable and won’t be used again).
Go to your Mac Mail app preferences:
With “Mail” app open, go to the Mail Preferences (under “Mail” next to the apple in the upper left corner of your screen). In preferences, select “Accounts” from the top line, and make sure you have the Yahoo email account selected in the left
hand side bar. Choose “Server Settings”.
Now PASTE the temporary password into the two places that ask for a password, Incoming and Outgoing Mail Servers.
Remember to “Save” at the bottom of the window. Close this Mail preferences window.
Go back to Yahoo and close the window there, too.
Now, try to send / receive mail on your Mac and see if that works for you.
Good luck!!
(If this doesn't work, you can just change the Mail Preference password back and continue your journey to a solution.)