Fix Server Settings When Mail Won't Send
In this article
If your email won't send, the cause is almost always incorrect outgoing server (SMTP) settings—specifically the server hostname, port number, or authentication method. To fix it, verify your SMTP server address, port (usually 587 for TLS or 465 for SSL), and that your username and password are correct, then test the connection.
Why Email Fails to Send
Email sending relies on SMTP (Simple Mail Transfer Protocol), which is separate from the receiving protocol (POP3 or IMAP). When you hit "send," your email client connects to your SMTP server, authenticates you, and hands off the message. If any of these steps fail, the email stays in your outbox. Common reasons include:
- Wrong SMTP hostname – e.g., using
smtp.gmail.comwhen your provider usesmail.yourdomain.com. - Incorrect port – Port 25 is often blocked by ISPs; 587 (STARTTLS) and 465 (SSL) are standard.
- Authentication errors – Your password may have changed, or you need an app-specific password for two-factor authentication.
- Firewall or antivirus blocking – Local software can interrupt the connection.
- Server-side issues – The mail server may be down or rejecting your IP.
How SMTP Settings Work
SMTP settings tell your email client where to deliver outgoing mail. The three critical pieces are:
- Server hostname – The domain name of your mail server (e.g.,
smtp.office365.com). - Port – A network endpoint. Port 587 is the default for submission with STARTTLS; port 465 is for implicit SSL; port 25 is the legacy relay port, often blocked.
- Authentication – Usually "Normal password" or "OAuth2". Some providers require an app password if you have 2FA enabled.
When you configure a client like Outlook, Thunderbird, or Apple Mail, these settings are stored in your account profile. If any one is wrong, the server rejects the connection or the authentication, and the message bounces back with an error like "SMTP server response: 535 Authentication failed" or "Connection timed out."
Step-by-Step Fix
Follow these steps in order. They cover the most common fixes first.
- Check your SMTP server details – Look up your email provider’s official SMTP settings. For example, Gmail uses
smtp.gmail.comwith port 587 and TLS; Outlook.com usessmtp-mail.outlook.comwith port 587. If you have a custom domain, your hosting provider’s documentation is authoritative. - Verify the port – Try port 587 with STARTTLS first. If that fails, try 465 with SSL. Avoid port 25 unless your provider specifically requires it.
- Check authentication – Ensure "Use secure password authentication" is enabled. If you have two-factor authentication, generate an app-specific password from your provider’s security page.
- Test the connection – Use a tool like
telnetor an online SMTP tester. For example, in a terminal on Windows or macOS, runtelnet smtp.gmail.com 587. If it connects, the server is reachable; if not, your firewall or ISP is blocking it. - Re-enter your password – Sometimes a simple typo is the culprit. Delete and re-type your password in the email client’s settings.
- Disable firewall/antivirus temporarily – If the connection works after disabling, add an exception for your email client.
- Try a different network – If you’re on a corporate or public Wi-Fi, the network may block SMTP ports. Test on your phone’s hotspot.
- Restart the email client – After changing settings, restart the app to ensure it picks up the new configuration.
Common SMTP Errors and Their Meanings
Error codes are your best clue. Here are the most frequent ones:
- 535 Authentication failed – Wrong username or password, or your provider requires an app password.
- 550 Relay denied – The server won’t accept mail from your IP. This often happens if you’re using a public SMTP relay without authorization.
- 421 Service not available – The server is temporarily down or your IP is rate-limited.
- 451 Requested action aborted – Usually a temporary server issue; wait and retry.
- Connection timed out – The port is blocked by a firewall, or the hostname is wrong.
If you see an error, search for the exact code plus your email provider’s name—you’ll often find a specific fix.
When to Use Different Ports
Choosing the right port is a common point of confusion. Here’s a quick guide:
- Port 25 – Used for server-to-server relay, not for client submission. Most ISPs block it to prevent spam.
- Port 587 – The standard for email clients. It requires STARTTLS (encryption starts after the connection is established).
- Port 465 – Used for implicit SSL. The connection is encrypted from the start. Some providers still support it, but 587 is preferred.
- Port 2525 – An alternative for providers that block 587, but not universally supported.
If your client offers a dropdown for "SSL" or "TLS," match it to the port: 465 for SSL, 587 for TLS. Using the wrong encryption type with a port will cause a handshake failure.
Testing Your SMTP Settings
Before making changes in your email client, test the settings independently. You can use a free online SMTP tester or a command-line tool. Here’s a simple way using openssl on macOS/Linux:
- Open a terminal.
- Run
openssl s_client -starttls smtp -connect smtp.gmail.com:587(replace with your server). - If you see
CONNECTED, the server and port are reachable. TypeEHLO test.comand press Enter. You should get a list of server capabilities. - Type
QUITto close.
If the connection fails, the issue is network-related. If it succeeds, the problem is likely in your client’s authentication settings.
Preventing Future Sending Issues
Once you’ve fixed the problem, take steps to avoid it recurring:
- Keep your email client updated – old versions may not support newer TLS protocols.
- Use an app-specific password if you have 2FA enabled – your regular password won’t work for SMTP.
- Check your provider’s status page – if the server is down, no setting will fix it.
- Document your settings – store the correct hostname, port, and encryption type in a secure note.
Frequently Asked Questions
Why does my email work on my phone but not on my computer?
Different devices store different settings. Your phone may already have the correct SMTP configuration, while your computer’s email client may be using an outdated port or password. Compare the settings on both devices.
What is the difference between SMTP and IMAP?
SMTP handles outgoing mail; IMAP handles incoming mail. When you send an email, your client uses SMTP to deliver it. IMAP only syncs messages from the server to your device. They are independent, so a sending issue doesn’t affect receiving.
Can I use port 25 for sending from my email client?
Technically yes, but most ISPs block port 25 to reduce spam. You’ll likely get a time-out. Use port 587 or 465 instead.
What does "STARTTLS" mean?
STARTTLS is a command that upgrades an unencrypted connection to a TLS-encrypted one. It’s used on port 587. If your client says "TLS" or "STARTTLS," it means the same thing.
My password is correct but I still get an authentication error. Why?
If you have two-factor authentication enabled, you need an app-specific password. Regular passwords are rejected for security. Generate one from your provider’s security settings and use that in your email client.
How do I find my SMTP server address?
Check your email provider’s help page. For popular services like Gmail, Yahoo, or Outlook.com, the SMTP hostname is well-documented. For custom domains, your hosting provider’s control panel or support page lists it.