communication
email_config
ai_generated
true
SMTP connection fails — TLS vs STARTTLS port confusion (465 vs 587)
ID: communication/smtp-tls-starttls-port-confusion
90%Fix Rate
92%Confidence
4Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| any | active | — | — | — |
Root Cause
Using implicit TLS (port 465) settings with STARTTLS port (587) or vice versa.
genericWorkarounds
-
93% success Use port 587 with STARTTLS for submission (RFC 8314)
smtplib.SMTP('smtp.example.com', 587); server.starttls() -
88% success Use port 465 with implicit TLS when STARTTLS is not supported
smtplib.SMTP_SSL('smtp.example.com', 465)
Dead Ends
Common approaches that don't work:
-
Use port 465 with STARTTLS
95% fail
Port 465 expects implicit TLS; STARTTLS is an upgrade from plaintext
-
Use port 587 with implicit SSL/TLS
95% fail
Port 587 starts plaintext and upgrades via STARTTLS