How make Mac OS mail Connection Doctor forget older accounts
Apple's Mail app stores the settings for SMTP servers apart from the settings for IMAP/POP3 servers. In my experience, this often leads to the fact that after deleting mail accounts, the SMTP servers are still visible in the connection doctor although all other data regarding a certain internet/email account have been removed.

In case the connection doctor shows you only the SMTP accounts of the already deleted mail accounts, please proceed as follows:


Open Mail > Settings > Accounts > SMTP-Server > Edit SMTP-Server list
In the dialog which opens: Select entries in the server list
Remove items by clicking on the minus-symbol below the list


In case the connection doctor also shows you the IMAP or POP3 account information of the  already deleted mail accounts, proceed as follows:


Quit Mail
Re-add the accounts using System Preferences > Internet Accounts
Open Mail
Quit Mail
Remove the accounts using System Preferences > Internet Accounts