Which Gmail SMTP port should I use in Mutt's smtp_url configuration option? I noticed that port 465 only works with smpts://..., while port 587 only works with smtp://... (by "works", I mean the ability to send emails without encountering any error messages in Mutt). What is the difference between the two ports? Which should I use?
Should I use this:
set ssl_force_tls = yes
set smtp_url = "smtps://@smtp.gmail.com:465/"Or this?
set ssl_force_tls = yes
set smtp_url = "smtp://:587/" 1 Answer
Port 465 is for implicit TLS while port 587 is for STARTTLS. The prefer approach is to use port 587. Use port 465 if port 587 fails.
Tl;dr Use port 587 if you can, 465 if you can’t, 25 if you must.
Port 587 is technically correct, the best kind of correct. However, many ESPs have adopted implicit TLS on port 465. While you can send email over port 25 and 2525, it’s much more secure to have the messages encrypted. This makes port 587 the preferred option for sending, with port 465 as a close second.
These ports are not specific to Gmail but well-known ports also used by other email service providers.
Source:What’s the Difference Between Ports 465 and 587?
3