Ports 465 and 587 are intended for email client to email server communication (sending email).
Port 465 is for smtps – SSL encryption is started automatically before any SMTP level communication.
Port 587 is for msa – it is almost like standard SMTP port. SSL encryption may be started by STARTTLS command at SMTP level if server supports it and your ISP does not filter server’s EHLO reply (reported 2014 Nov). MSA should accept email after authentication (e.g. after SMTP AUTH). It helps to stop outgoing spam when netmasters of DUL ranges can block outgoing connections to SMTP port (port 25)
Port 25 is used by MTA to MTA communication (mail server to mail server). It may be used for client to server communication but it is not currently the most recommended. Standard SMTP port accepts email from other mail servers to its “internal” mailboxes without authentication.