Known issue with Apple Mail and El Capitan.
After upgrading to El Capitan, Mac mail prompts for the email account's password but won't accept it.
Restarting the computer and disabling mail accounts in the process, then adding them back on account at a time resolves the problem.
Here is how to Temporarily stop using an account in Mail
Choose Mail > Accounts, select the account, then deselect the Mail checkbox; the account’s messages are no longer shown in Mail.
To use the account again with Mail, select the Mail checkbox; the account’s messages are shown again (they don’t need to be downloaded from the server again).