One particular Yosemite Mail issue revolves around it’s “Automatically detect and maintain account settings” preference. Each account has this setting in two places, and it’s checked by default. Many users have discovered that Mail will guess wrong when then is checked, which causes connection failures. The fix is to uncheck this setting and fill in the right port/authentication settings manually, just as in previous versions of Mail. But you have to do this for each account, both incoming and outgoing…. Which requires a lot of clicking.

For incoming mail this “Automatically detect and maintain account settings” preference is in Mail->Preferences->Accounts->Account Name->Advanced, and for outgoing mail it is in Mail->Preferences->Accounts->Account Name->Account Information->Edit SMTP Server List (from the Outgoing Mail Server SMTP menu).