Click the More Settings... button and select the Advanced tab. For "Use the following type of encrypted connection:" select SSL for the IMAP server and TLS for the SMTP server. The (IMAP) port should be 993 and change the (SMTP) port from 25 to 587.