Both are valid modern choices for authenticated mail submission. Port 587 uses STARTTLS (starts plaintext, upgrades to TLS). Port 465 uses implicit TLS (TLS from the first byte). RFC 8314 (2018) treats them as equal alternatives. Some providers support only one: Microsoft 365 only supports port 587; Gmail supports both. If you can, use 465 — implicit TLS is harder to strip via downgrade attack. If your client library only supports STARTTLS, use 587 with STARTTLS required (fail if unavailable, don’t silently downgrade). Never use port 25 for authenticated submission. Check port reachability with the port scanner.
All questions