Please clarify a few things... Do you run your own SMTP server that you're connecting to, or you're just connecting to your ISPs SMTP server?
The reason I ask is because you can use TLS over normal SMTP port 25, or via the special reserved port of 465. The difference is that port 25 only supports TLS with ESMTP and the STARTTLS derictive. By standard, SMTP daemons listening on 465 must *only* accept TLS, so there is no STARTTLS directive, it just immediately negotiates the TLS handshake.
If you're running your own server, just configure it to have STARTTLS as an option in ESMTP over port 25 and forget about port 465. If you're connecting to your ISP, I can nearly guarantee they won't be using port 465 (it's an almost unused standard). You can tell if it will support TLS over port 25 by doing this:
Code:
-bash-2.05b$ telnet mailserver 25
Trying 192.168.0.5...
Connected to mailserver.
Escape character is '^]'.
220 SMTP Proxy Server Ready
ehlo foo
250-mailserver.domain.tld ESMTP Server Ready
250-SIZE 0
250-STARTTLS
250-TLS
250-AUTH LOGIN
250-AUTH=LOGIN
250 DSN
quit
221 Service closing transmission channel closing connection
Connection closed by foreign host.
Notice where it says "250-STARTTLS"? That indicates that it will accept a TLS negotiation over port 25.