There is a big problem on Mail n OSX, it never forgets old passwords, if the PW is corrupted or changed, no matter what you type in for PW, it'll send the old one.
Open Keychain Access in Utilities, then either check the Password under that item, change it, or delete it and start over.
Enter the part after the @sign in the search bar.
You may have duplicate or more entries in Keychain Access.
If using a browser to login via WebMail works it's not Name or Password, but likely old passwords interfering.
There''ll be at least 2 entries, maybe more.
The trouble is that Mac Mail almost always chooses the old Passwords if you don't change or get rid of the old ones.
Restart to clear some caches.
The big bugaboo with Mail is finding the keychain for any auto setup Mail accounts, if IMAP it usually involves deleting the account & setting it up again to fix it.
Not sure on the following...
Cant create re add Mail
James Walker1 User level:Level 1 (129 points)
Mar 1, 2019 10:39 AM in response to if240
I was having this problem trying to add a mail (not gmail) account just for Notes. In my ~/Library/Keychains folder, I found a subfolder with a long hexadecimal and hyphens name. I deleted that subfolder, logged out, and logged back in. I was then able to add the account, without having lost any passwords from my keychains.