Port 587 is the designated submission port (RFC 6409): the port where mail clients hand outgoing mail to their provider, with authentication required and STARTTLS expected. It has no single error code of its own; instead, submission failures arrive as connection errors or as codes like 530, 504, and 535, each pointing at one layer of the setup. The layers, from the wire up, are: the port must be reachable, encryption must start, authentication must be offered, and the credentials must be right. Testing in that order finds the fault without guessing.
Test-NetConnection smtp.example.com -Port 587 confirms reachability. Deeper tests with an EHLO over a TLS session show the server's advertised STARTTLS and AUTH capabilities in plain text, ending all speculation about what the server offers.Providers are steadily closing the alternatives: port 25 submission without authentication is refused almost everywhere now, which is why old configurations that worked for years fail suddenly. A client set to port 587, STARTTLS, authentication on, with the full address as username and an app password where two-step verification applies, matches what every major provider now expects.
What is the difference between ports 587 and 465? Both are submission ports with different encryption styles: 587 upgrades a plain connection with STARTTLS, while 465 uses implicit TLS from the first byte. Either works when the client's encryption setting matches the port; mixing them is the classic failure.
Why does my provider tell me not to use port 25? Port 25 is the server-to-server relay port, and providers block or refuse unauthenticated client submission on it to fight spam. Port 587 exists precisely to give clients an authenticated, encrypted path that 25 was never designed to be.