I just had the problem, that I could not send mails over one specific SMTP-Server. I could receive though.
First, please make sure, you actually connect to any server by using the “Connection Doctor” built into mail.
If there is no connection possible to the server, you have different problem.
If you are connected but the wheel keeps spinning, the solution is somewhat stupid.
1) Close Mail
2) Go to System Preferences > Internet Accounts
3) Then select the account you are experiencing problem with and uncheck the option mail.
4) Open mail to make sure, the account is gone, and close it again.
5) Check the option for mail in your account preferences again.
After this, you should be able to send mail again.