If you just upgraded to El Capitan Mac OS X, you may have expected a better Apple Mail.
While a better Apple mail is not what Apple has got to deliver us as priority (oh Eudora I miss you), there are worst things you may bump into as soon as you open Apple Mail with El Capitan the first time: all configured email accounts got SMTP settings mixed up! In fact, when you try to send an email, Apple Mail uses a random unconfigured SMTP server of your list. And everything was working perfectly before upgrading!
If you try to re-configure them by selecting each email account under Apple Mail -> Preferences -> Accounts and by setting back the correct Outgoing Mail Server (SMTP) using the pull down menu, well, they just don’t get saved and they keep on being unassigned.
Also my emails are all getting the lastest SMTP I configure despite the previous one I saved was different.
After some tries, I found out a solution to bring the SMTP’s back to work.
When you open the SMTP Pull Down menu for each email account you are going to fix, be sure to CHANGE THE NAME in the Description Field. This forces Apple Mail to re-write the entry plist xml file for that account, fixing it.
So open each SMTP entry, change the value in the Description field with a new one, close to save and you’re back with a working smtp Apple Mail in El Capitan.
Happy (Apple) Mail again!
Update 24 Oct 2015 El Capitan 10.11.1 seems to address this smtp issue.