How do I send email from my server?
There are two ways to send email from your server: through an email service, or with your own mail server. The first needs nothing opened. For the second, you open outgoing port 25 from your panel.
Sending through an email service
This is the easiest way for WordPress, WooCommerce, Nextcloud and most apps. You put your email service's address and password in the app's SMTP settings. These services use port 587 or 465, and those ports are always open on your server.
Sending with your own mail server
Mail servers deliver to each other over port 25. On new servers, outgoing port 25 starts closed. We start it this way because one server sending spam can get everyone on the same IP block blacklisted. Opening it takes one click:
- In your panel, open My Servers and click your server.
- Open the Firewall Rules tool.
- In the Sending email row, press Open port 25 and confirm.
The setting applies within about 15 seconds, and you don't need to restart the server. Your choice stays if you reinstall the server. When you no longer need it, you can close it from the same place.
You can test that the port is open on your server like this:
timeout 5 bash -c 'exec 3<>/dev/tcp/gmail-smtp-in.l.google.com/25' && echo "25 open" || echo "25 closed"
What to keep in mind
- Incoming email isn't affected by this setting. It only covers connections going out from your server.
- An allow rule you add to the firewall doesn't get around this setting. You open the port only with this button.
- For your mail to reach inboxes you need SPF, DKIM and DMARC records. See before you run your own mail server for the details.
- Sending unsolicited bulk email breaks the service agreement and can get your service suspended.
Thanks for your feedback!