Port 25 (SMTP)

Port 25 is SMTP between mail servers: when your provider delivers a message to another domain, it connects to that domain’s mail server on port 25. Email apps sending as a user should use 587 or 465 instead.

Service
SMTP
Protocol
TCP
IANA registry
Officially assigned: smtp (Simple Mail Transfer), TCP/UDP

Check if a port is open on your IP

We only check the address you are visiting from, one TCP port at a time. You cannot enter someone else’s address: this is not a port scanner.

Is it safe to open port 25?

A mail server must accept connections on 25 from the internet, but it must not relay mail for strangers, or spammers will use it. Many home ISPs and cloud platforms block outgoing port 25 (Google Cloud does so for external destinations), which is why a script on a VPS often cannot send mail directly.

Sources

“Port 25 is already in use”: how to fix it

The error means another program is already listening on port 25. Find its process ID (PID), then stop that program or start yours on a different port.

Windows (Command Prompt or PowerShell as administrator)

netstat -ano | findstr :25
taskkill /PID <PID> /F

macOS

lsof -nP -iTCP:25 -sTCP:LISTEN
kill <PID>

Linux

sudo ss -ltnp | grep :25
sudo lsof -i :25
sudo kill <PID>

Replace <PID> with the number from the last column (Windows) or the PID column (macOS, Linux).

Port 25 vs 587

Port 25 is for server-to-server delivery; 587 is for users and apps submitting mail with a login. If your app sends through a provider, use 587 (or 465). Port 25 from home or a cloud VM is often blocked anyway.

Port 587 (SMTP submission)

Why a port can look closed when your server is running

Most home networks sit behind a router doing NAT: the router owns the public address, and your computer has a private one such as 192.168.1.10. A connection from the internet reaches the router and stops there unless you add a port forwarding rule to your computer.

Many mobile and some home providers go further and use carrier-grade NAT (CGNAT): several customers share one public address, and your router itself gets an address from 100.64.0.0/10. Then no rule on your side can open a port; ask the provider for a public IP or use a tunnel or VPN service.

Even with forwarding in place, the firewall on the computer (Windows Defender Firewall, ufw, firewalld) must allow the port, and the program must listen on all interfaces (0.0.0.0), not only on 127.0.0.1.

UDP cannot be checked this way: a UDP service usually stays silent to packets it does not understand, so “no answer” means nothing. This check uses TCP only.

Frequently asked questions

What is port 25 used for?

Port 25 is SMTP between mail servers: when your provider delivers a message to another domain, it connects to that domain’s mail server on port 25. Email apps sending as a user should use 587 or 465 instead.

Is port 25 TCP or UDP?

Port 25 uses TCP. IANA reserves the number for both TCP and UDP, but in practice only TCP is used.

Is it safe to open port 25?

A mail server must accept connections on 25 from the internet, but it must not relay mail for strangers, or spammers will use it. Many home ISPs and cloud platforms block outgoing port 25 (Google Cloud does so for external destinations), which is why a script on a VPS often cannot send mail directly.

How do I free port 25 if it is already in use?

Find the process: on Windows run netstat -ano | findstr :25 and stop it with taskkill /PID <pid> /F; on macOS or Linux run lsof -i :25 and stop it with kill <pid>.

Source: IANA Service Name and Transport Protocol Port Number Registry, last updated 2026-11-10, retrieved 2026-11-12.