I've had this problem for a while, but I hate not knowing or getting to the bottom of things, so here I am! :)
On an iMac I am running El Capitan 10.11.6 and in the Mail app I successfully send and receive emails from five separate accounts. So all seems good.
However, if I go to System Preferences > Internet Accounts and manually select each of these five accounts, for two of them I get the following Can't connect to the account error message:
Now, when I enter my password, I get the Unable to verify account name or password prompt in red text:
I manage my own domain and email accounts, so know for a fact I have the correct passwords. And, as I said, I am using these accounts fine within Mail. I also use them fine on various iPhones and iPads and other Macs.
Any suggestions as to what's going on?