+254725682556 +254725052660 info@ziprof.co.ke
Client Area

Email

Why Port 25 Is Blocked and Which SMTP Port You Should Use to Send Email

If email from your website, a desktop application, or a script fails to send and you're connecting on port 25, that's almost always the problem. Port 25 is reserved for server-to-server mail delivery and is blocked by most internet providers, office networks, and even many hosting environments to cut down on spam. For sending mail from your own device or application, you should use port 587 or port 465 instead, with authentication turned on.

Why port 25 doesn't work for you

Port 25 is meant for one mail server to hand off a message to another mail server automatically, not for a person or an application to log in and send mail directly. Because spammers abused this for years, most residential and business internet connections now block outbound traffic on port 25 entirely. Even if your connection allows it, sending through port 25 usually skips authentication, so a properly configured mail server will refuse the message anyway.

Which port should you use instead

  • Port 587: the standard port for sending authenticated mail using STARTTLS (the connection starts unencrypted and then upgrades to an encrypted one). This is the recommended option for most email clients and applications.
  • Port 465: used for sending mail over an encrypted connection from the start (SSL/TLS). Many email clients and libraries support this as an alternative to 587.

Both require you to log in with your full email address and password, the same credentials you use for incoming mail.

Setting it up correctly

  1. In your email client, website contact form plugin, or application's mail settings, set the outgoing (SMTP) server to your domain's mail server hostname, for example mail.yourdomain.com.
  2. Set the port to 587 with STARTTLS, or 465 with SSL/TLS, depending on what the client supports.
  3. Turn on SMTP authentication and enter your full email address and password. Don't leave this blank or set to 'none.'
  4. Save and send a test message to confirm it goes through.
If you're coding a website or application to send mail (a contact form, an order confirmation, a password reset), use your mail server's SMTP credentials with port 587 or 465 rather than a local, unauthenticated mail function. Sending without authentication is one of the most common reasons automated emails silently fail or land in spam.

Still can't send mail?

  • Double-check the port and encryption method match. Port 587 should be paired with STARTTLS, and port 465 with SSL/TLS; mixing them up causes connection errors.
  • Confirm you're using your full email address as the username, not just the part before the @ sign.
  • If you're on an office or institutional network, ask whoever manages it whether outbound mail ports are restricted. Some networks block 587 and 465 too, not just 25.
  • If the error mentions authentication specifically rather than a connection timeout, re-enter your email password carefully, as that usually points to incorrect credentials rather than a blocked port.

If your email account itself seems to have a deeper problem beyond port settings, see How to Fix an Email Account That Isn't Sending or Receiving Mail.