If you’re developing an application for a healthcare organization or a booking platform, you rely on transactional email for critical application functions. From appointment reminders and booking confirmations to patient portal password resets and two-factor authentication codes, embedded email automation becomes a critical operational function for user engagement.

One common issue you may experience after setting up a mail server is email failing to send. This typically happens when pointing the application at the original SMTP default port, it may result in emails failing to send, or worse, sending but landing directly in the user’s spam folder. For developers and system administrators, this frustrating scenario often points to one common, intentional roadblock: port 25 blocking.

As a managed cloud provider with over 30 years in the industry, Atlantic.Net has many clients resolve this exact issue. This isn’t a bug in your code or a misconfigured server; it’s caused by a global security policy applied to the server.

Here’s what you need to know to get your emails flowing securely and reliably.

In a Hurry? The 60-Second Fix

Your emails are failing because your cloud provider is blocking outgoing Port 25 to prevent spam.

  • Do NOT use Port 25 for sending email from your application.
  • Change your application’s SMTP configuration to use:
    • Port: 587 (with STARTTLS encryption)
    • Port: 465 (with Implicit TLS/SSL encryption)
  • Ensure you are using authentication (a username and password) for your mail server.
  • For best results, use a dedicated transactional email service (like SendGrid, Postmark, or Mailgun) and configure SPF, DKIM, and DMARC records for your domain.

Why Is Port 25 Blocked?

Port 25 is the original default port for Simple Mail Transfer Protocol (SMTP), the protocol that moves email from one server to another. In the early days of the internet, SMTP was built on trust. Servers didn’t require authentication to accept and forward an email. This “open relay” design was simple, but it was incredibly insecure. Spammers and botnet operators began to exploit it. They would scan the internet for compromised servers (“zombie computers”) and misconfigured mail servers, using them as open relays to send  millions of spam and phishing emails. To combat this problem, global action was needed:

  • ISPs and cloud providers (like Atlantic.Net) began blocking all outgoing traffic on Port 25 from end-user devices and cloud servers.

Blocking Port 25 is a critical security measure. It protects the provider’s network reputation and prevents their IP address ranges from being blacklisted. It ensures that legitimate customer traffic isn’t impacted by spam.
Therefore, you cannot, and should not force your application to use Port 25 for sending email. Even if you could, most receiving servers would block your mail anyway, suspecting it as spam.

Use the Correct, Secure Ports

Stop using Port 25 for email submission (sending mail from your app to your mail server) and instead  use the modern, secure ports designated for this exact purpose.

  • Port 587 (Recommended): This is the standard port for email submission. It uses STARTTLS, an opportunistic encryption command. The connection starts in plain text, but the first command from your application is to “upgrade” the connection to a secure, encrypted TLS (Transport Layer Security) channel before any credentials or email data are sent. It requires authentication.
  • Port 465 (Alternative): This port is for SMTPS (SMTP Secure) and uses Implicit TLS. The entire connection is wrapped in a TLS/SSL tunnel from the very beginning. While once deprecated, it was officially reinstated by RFC 8314 and is a widely accepted, secure standard.
Port Protocol Encryption Authentication Primary Use
25 SMTP None (Opportunistic) Optional Server-to-Server mail relay. Should be blocked for clients.
587 SMTP Submission STARTTLS (Explicit) Required Recommended Standard for applications sending email.
465 SMTPS Implicit TLS Required Excellent, modern alternative for applications.

How to Test Your SMTP Port Connection

How do you know if you can even reach your mail server on these ports? You can test the port connection directly from your server’s command line. For Port 587 (STARTTLS), you can use the telnet utility. By running the command telnet smtp.yourprovider.com 587, you are attempting to open a simple, unencrypted connection. A successful connection will immediately return a 220 … ESMTP Service ready response, indicating the port is open and the mail service is listening. At that point, you could type EHLO yourdomain.com to see the server’s capabilities, which should include STARTTLS, before typing quit to exit.

Testing Port 465 (Implicit TLS) is slightly different. You cannot use telnet because this port expects the connection to be wrapped in SSL/TLS from the very beginning. Instead, you should use a tool like openssl. The command openssl s_client -crlf -connect smtp.google.com:465 -debug -msg will initiate the secure connection, display the server’s SSL certificate details, and then show the 220 SMTP welcome message if successful.

If either test results in a “Connection timed out” or “Connection refused” error, it’s a strong indicator that the port is being blocked by a firewall, either on your local server or on the provider’s side.

Ensuring Deliverability with SPF, DKIM, and DMARC

Please bare with me because I need to get technical to explain this. Using the correct port ensures your email sends, but ensuring deliverability (reaching the inbox) requires proving your identity to receiving servers.

This is handled by the “Authentication Triad”—SPF, DKIM, and DMARC—which are all configured in your domain’s DNS settings.

  • SPF (Sender Policy Framework) is a DNS TXT record that lists all IP addresses authorized to send email for your domain. Receiving servers check this record; if the sender’s IP doesn’t match, the email is treated as suspicious.
  • DKIM (DomainKeys Identified Mail) provides a digital signature for your emails. It uses a private key on your server to sign the message and a public key, published in DNS, for receivers to verify it. A valid signature proves the email is from your domain and that its content has not been altered.
  • DMARC (Domain-based Message Authentication, Reporting & Conformance) unifies SPF and DKIM. This DNS record tells receivers what policy to apply if a message fails those checks, such as p=quarantine (send to spam) or p=reject (block). It also enables reporting on email activity.

For any serious application, implementing all three is mandatory for deliverability and security.

Self-Hosting vs. Third-Party Relays

While reconfiguring your port is the direct fix, you must also decide how to send your email. You have two main options: managing your own mail server (like Postfix or Exim) on your VM, or using a third-party transactional email service (like SendGrid or Postmark).

Self-hosting gives you complete control over logs and configuration, but it comes with significant technical burden. You are solely responsible for the complex setup, ongoing maintenance, and (most difficult) managing your server’s IP reputation. Poor reputation management will get your emails blacklisted, making deliverability a constant, difficult battle. You also have to build your own analytics and manage all compliance (like HIPAA) yourself.

A third-party relay is the recommended solution for most applications. These services are built specifically for high deliverability. They handle IP warming, reputation management, and provider relationships for you. Setup is fast (often minutes), and they provide built-in analytics for opens, clicks, and bounces. For healthcare, top providers offer Business Associate Agreements (BAAs) to help with HIPAA compliance. While this means less direct control and a predictable per-email cost, it offloads immense complexity.

For 99% of applications, especially in healthcare and booking, a dedicated third-party service is the professional-grade solution. The cost and complexity of managing your own email deliverability are almost never worth it.

Special Considerations for Sensitive Industries

But for sensitive industries, getting the email sent is only the first step. Security and compliance is essential.

For Healthcare: HIPAA Compliant Email

When an email (even an appointment reminder) contains Protected Health Information (PHI), HIPAA rules apply.

  • You Must Have a BAA: You must have a signed Business Associate Agreement (BAA) with your hosting provider (like Atlantic.Net for HIPAA-Compliant Hosting) and any third-party email provider you use. A BAA is a legal contract that obligates the provider to safeguard PHI.
  • Crucial: A BAA with your host does not cover a third-party email service. If your email provider (including Gmail or Microsoft 365) does not provide a BAA, you cannot use it to send PHI.
  • End-to-End Encryption: HIPAA demands encryption for PHI “in-transit” (while being sent) and “at-rest” (in the database). Using Port 587 or 465 with TLS is a mandatory part of securing data in-transit.
  • What is PHI? A name and an appointment time (“Jane Doe, 2:30 PM, Oncology Dept”) is PHI. A password reset link for a patient portal is also considered PHI by proxy, as it grants access to it.
  • Best Practice: Avoid sending PHI in the email body or subject line. Send a generic notification (“You have a new message in your secure patient portal”) that requires the user to log in to your secure, compliant application.

For Booking Platforms: Trust and Reliability

For booking and scheduling systems, the primary concerns are reliability and user trust.

  • Use a Recognizable “From” Address: Avoid [email protected]. It feels impersonal and blocks users from replying with questions. Use something clear, like [email protected] or [email protected].
  • Separate Transactional and Marketing Mail: Send your password resets and booking confirmations from a different IP and subdomain (e.g., app.yourdomain.com) than your marketing newsletters (e.g., marketing.yourdomain.com). This protects the deliverability of your critical emails if your marketing mail ever gets flagged as spam.
  • Make It Clear and Actionable: The email must clearly state the time, date, and location (or virtual link). Most importantly, include obvious, one-click links to “Confirm,” “Reschedule,” or “Cancel.” This reduces no-shows and administrative overhead.

Need a secure, compliant foundation for your healthcare or booking application? Atlantic.Net offers robust, 24/7-supported HIPAA-Compliant Hosting and Managed Cloud Services from our 8 global data centers. We handle the secure infrastructure, so you can focus on building your application.

Contact us today to learn how we can help you build and deploy with confidence.