Port 587 is the explicit SSL/TLS port for the SMTP protocol. The implicit SSL/TLS port is 465. The difference between implicit SSL and explicit SSL is that for implicit, the SSL handshake begins immediately after establishing the TCP socket connection. For explicit SSL, the SSL handshake (i.e. the conversion of the TCP socket connection to an SSL/TLS secure channel) happens when the SMTP client explicitly sends a command to the server to initiate the SSL handshake. In the SMTP protocol, this happens with the "STARTTLS" SMTP command.

Therefore, to use explicit SSL with port 587, set the mailman.StartTLS property = 1 (which is for explicit SSL/TLS), but leave the mailman.SmtpSsl property = 0 (which is for implicit SSL/TLS). It never makes sense to set both the SmtpSsl and StartTLS properties = 1.