To double-check your IMAP and SMTP settings (including checking that SSL is enabled), pick Preferences... from the main Mail menu.