Well since we are all on Mac Mail, here are some typical issues and problems. Normally the thing works fine, but there is something strange with how it stores things and sometimes it forgets the SMTP password.
Here are some of the tricks:

1. You want to run IMAP and SMTP on initial setup, OS X starts a System Preferences item called Internet Accounts and creates both IMAP and SMTP entries.
2. However, they are actually two totally separate items. When you choose Mail/Accounts, it (inexplicably) only shows you the IMAP read accounts and not the write ones. You have to look down into the entry and click on Advanced and then you will see the IMAP entries. For most IMAP systems, you want the high security port 993 and use SSL.

3. To see the SMTP or outbound is much harder. Most of the send errors are because the passwords are kept in separate places, so you an have a password for the SMTP and IMAP. Go to Mail and open Preferences/Accounts and click on the account and click on Outgoing Mail Server (SMTP) and go to the bottom of the combo box and chooseEdit SMTP Server Listand selectAdvancedand you will see the port (should be 587 for SSL) and authenticationPassword`

For iOS devices, there is a similarly confusing list and duality.