Your configuration in this post, if it’s the same one that generated this traceback, is correct. Use that one (port 587, and STARTTLS).
Port 587 is for TLS encryption negotiated after the initial connection (STARTTLS), whereas
Port 465 is for TLS encryption at connect time (SSL/TLS).
But many providers (correctly) block port 465 because of historical reasons, so 587 is recommended.