I experienced the same SMTP-problems, even though my mail situation is a little different. I’m giving an (elaborate) explanation below of dealing with this bug. Apologies for a long story, but I think it important to mention what did and didn’t work so that it will hopefully save people a lot of time/energy not having to try it for themselves.
SITUATION
I use 5 email accounts on iMac and iPhone. Accounts on iMac are configured as pop (with purpose as archive). On iPhone accounts are imap. 4 of 5 accounts are Gmail, the other one Hosted Exchange. Gmail accounts are all configured correctly in ways such as: pop/imap enabled, less secure apps allowed, application password for Mail and iPhone (in case of 2-way verification). The Hosted Exchange account doesn’t allow for imap, but works with pop.
PROBLEM
After adding a couple of new Gmail accounts on iMac these new accounts received email, but couldn’t send it, even though account/server info was definitely correct. Mail reported it couldn’t verify user and/or password info. Things got worse when fiddling with the Mail>Prefs>Accounts>Server Settings>SMTP List and problems became seemingly random: manually added SMTP servers didn’t function (“couldn’t verify user and/or password info”), or were forgotten right after adding them by not showing in the drop-down SMTP-server list. Servers appeared as ‘offline’, where they weren’t. Connection check in Mail showed all lights green, but no joy. Newly added servers were sometimes actually stored (and at times re-forgotten after Mail quit) and selected by drop-down list, but then spontaneously changed back to other settings after a couple of seconds. Editing SMTP-keys in the keychain didn’t help for storing settings, nor getting them to work. Deleting all SMTP-servers in Mail and re-adding them didn’t work. Some times 1 account would get to function properly, but then others would fail and vice versa.
SOLUTION
I read somewhere that this was an iCloud related problem and it was, but also a Mail problem. I started by a making a fresh backup of the HD as a safety net. Then made a folder on the desktop and exported all In- and Outboxes (I don’t use subfolders, but if you do: export them). This went quite quick despite of one account holding +15000 mails dating back to 2002. Then, for safety, I also copied some locally stored iCloud data (contacts, etc). Went to System Prefs>iCloud and logged off. After i got the message of storing the data locally pressed ‘no’. Then in System Prefs>Internet Accounts deleted all pop-accounts. Starting Mail I verified that all mail-data was indeed gone. Took an extra measure and by deleting contents of User>Library>Mail to get a fresh start. Restarted iCloud (data was restored by re-download). Then made new pop-accounts via Mail>Prefs>Accounts (not in System Prefs>Internet Accounts).
On a sidenote: with Gmail nowadays it takes a workaround to set up a pop-account: in Mail>Prefs>Accounts press the ‘+’ and select ‘other’ at the bottom. Fill in your email, but a wrong password. You will get notice that verification failed, but also an dropdown-option to change IMAP to POP and add right server-info. This worked: no more connection errors. SMTP data was stored correctly and associated with the right email accounts.
Okidoki: receiving and sending mail was working again.
The fun didn’t end there: now to get the old mailboxes back. Importing the mailboxes went ok, except for the one with the +15000 mails. Mail wouldn’t import messages from this Inbox before January 2013. Not sure why, because the Outbox gave no problems with dates before 2013. Rebuilding the mailbox prior or after export/import had no effect. I also tried copying back the contents of the mail-folder on the freshly made backup to User>Library>Mail, thinking that, now the account-info was ok again (and stored elsewhere in the system), I could ‘marry’ it to my old mailbox data: it didn’t work. When starting Mail the mailboxes showed empty. Again: rebuilding mailboxes didn’t work.
I wasn’t satisfied with losing half my archive just to get accounts working again, so I restored the backup to my HD (effectively re-creating the problematic situation, but now knowing a solution) and instead of exporting the +15000 Inbox, I moved all messaged in a newly created mailbox in Mail, locally stored on the iMac. This proofed an good workaround for the import-error, because when a pop-account is deleted in either Mail or Prefs>Internet Accounts, all associated data with the account is removed with it. But when (in Mail) you move all messages to a mailbox apart from that pop-account, the messages will remain. This action of moving so many messages took quite some time. I could see Mail work overtime (Activity Monitor) and let it do it’s job. Did the same with the Outbox of this account, just to be safe. The other accounts didn’t date back before 2013, so I trusted I could manage with the exported mailboxes from earlier.
I tried a step in between just to see if the SMTP-errors were solely an iCloud or Mail problem by logging out of iCloud and logging back in without deleting all the pop-mail accounts in Prefs>Internet Accounts. Didn’t work: connection problems prevailed. Also deleting and re-adding pop-accounts without logging out and in of iCloud didn’t work.
So then I did again what I’d already done before: log off iCloud, delete all the pop-accounts in Prefs>Internet Accounts. Restarted iCloud, re-made all pop-accounts. Again: now things were working smoothly with no errors. Then I moved all the messages from the biggest mail account from within Mail back to the In- and Outbox of the associated email account, imported the exported mailboxes, and voila.
FINALLY, it worked and without having lost any data. This ordeal took me over a week to solve. It’s clearly a bug. Reading the forums, it’s apparently been going on for years, but I hope my dealings will help other folk to take care when bumping into this mess.