My IMAP server is "ssl0.ovh.net", it listens on SSL port 993 with authentication. It also listen on port 143 for non-SSL IMAP (with authentication).
For SMTP, the address is the same, it listens on SSL port 465 with authentication. It also listen on port 25 and 587 for non-SSL SMTP.
Port 587 and 143 for SMTP (respectively IMAP) both work, but not 465 nor 993. When I set any of the later (+ check the "Use SSL" option) it hangs for one or two minutes then give a "timeout" error.