Outlook opens, you type in your username and password, and a few seconds later the same familiar message appears: "Something went wrong" or, in the Persian version, "Connection to the server could not be established." You haven't mistyped your password, and your internet isn't down. The problem is almost always in one specific place: one of the four values — server, port, encryption, or username — doesn't match what your server expects. This article was written for exactly that moment; sit down and let's check the values together, one by one.
Setting up email with IMAP: the four values that must be exact
First of all, you need to know whether your account is IMAP or POP3. If you work with the same mailbox across multiple devices (laptop, phone, tablet), IMAP is the right choice, because folders and read status stay on the server and sync across devices. POP3 downloads messages to one device and leaves the others in the dark. For 95% of today's users, it's IMAP.
Now the values. The incoming server is usually written as mail.example.com, but that isn't always correct. If the domain's email is on a separate email service (like Google Workspace or Microsoft 365), you need to look at the domain's MX record and enter that host. To do this, use the MX record lookup tool; the output tells you where the domain's email is actually delivered. If the MX points to a server other than your web host, entering mail.example.com in Outlook will only keep you stuck in an error loop.
The table below shows the common values. Take the "Encryption" column seriously; many "server not responding" errors come from a mismatch in this very column.
| Role | Sample host | Port | Encryption |
|---|---|---|---|
| IMAP | mail.example.com | 993 | SSL/TLS |
| IMAP (no SSL) | mail.example.com | 143 | STARTTLS |
| POP3 | mail.example.com | 995 | SSL/TLS |
| SMTP | mail.example.com | 465 | SSL/TLS |
| SMTP | mail.example.com | 587 | STARTTLS |
A point that's rarely mentioned: ports 465 and 587 are both SMTP, but one requires direct SSL and the other requires STARTTLS. If you set port 465 in Outlook with the STARTTLS option, the connection breaks at the handshake stage and the error message is usually vague. Simple rule: 465 with SSL/TLS, 587 with STARTTLS. That's it.
Username: the full address, not just the part before @
In most control panels, the username is the full email address (info@example.com), but in some configurations just the part before @ is enough. If you're not sure, enter the full address; almost all servers accept it. Also type the password manually rather than copy-pasting it from a text file; an extra space at the end of the string is one of the most common reasons for "wrong password" when the password is actually correct.
Why Outlook won't connect but webmail opens
This difference clarifies a lot. If webmail opens on the same server but Outlook won't connect, the problem is definitely not the email server; it's the client, the port, or the network. Three common causes:
- Network firewall. Many corporate networks and some mobile carriers block outgoing port 25 and sometimes restrict 143 and 587 as well. If SMTP doesn't work on 587, try 465.
- Two-factor authentication. If 2FA is enabled on the email account, don't put the main password in Outlook; you need to create an "App Password." The telltale sign is that the password works in webmail but is rejected in Outlook.
- Expired or self-signed SSL certificate. In this case Outlook shows a warning and won't continue the connection. The real solution is fixing the certificate on the server, not ticking "ignore certificate."
For a quick test from the command line, this command answers much faster than clicking around in a graphical interface:
openssl s_client -connect mail.example.com:993 -servername mail.example.com
If the output includes Verify return code: 0 (ok), the certificate is healthy and the problem is elsewhere. If you see unable to get local issuer certificate, the certificate chain on the server is incomplete. Repeat the same test for SMTP on 465 or 587.
Setting up email on your phone: Android and iPhone
On iPhone, the path is Settings → Mail → Accounts → Add Account → Other. Choose the "Other" option, not "iCloud" or "Google," because those impose their own settings. On Android, in Gmail tap "Other" and set the account type to IMAP.
One trap on iPhone: if after entering the information you see "Cannot Verify Server Identity," it usually means the hostname in the certificate doesn't match what you typed. If the certificate is issued for mail.example.com, typing example.com or the server's IP address produces this same error. Write the hostname exactly as it appears in the certificate.
On Android, some versions of Gmail leave the "Require sign-in" option off by default at the "Outgoing server" stage, and then sending email fails while receiving works. If receiving is fine but sending isn't, check this checkbox first.
This is where people go wrong
A common error I've seen a lot: the user sets the incoming and outgoing server to the same thing and then, a few days later, says "my emails aren't being sent." In reality, the incoming server is IMAP, not SMTP; Outlook writes the message, keeps it in the Outbox, and silently retries every few minutes. The sign is that the message stays in the Outbox folder and you see no clear error. Set the outgoing server separately and to SMTP.
Mistake number two: using port 25 for SMTP. This port is blocked on most networks, and even if it's open, receiving servers will very likely treat emails sent through it as spam. Leave port 25 alone; use 465 or 587.
Common connection errors and what they really mean
"0x800CCC0E" in Outlook means the connection to the server could not be established. Almost always the port or the firewall. "0x800CCC92" means the username or password was rejected; go back to the App Password section. "0x800CCC0F" means the connection dropped mid-way; usually an unstable network or a limit on simultaneous connections on the server.
On your phone, the message "Authentication failed" with no further detail means one of two things: wrong password, or the server won't accept authentication because encryption is off. If you've set encryption to "None" and the server doesn't allow it, switch back to SSL/TLS.
A practical limitation that's rarely mentioned: some servers limit the number of simultaneous IMAP connections from a single account (say, 5 or 10). If you're connected on four devices and two clients at once, the fifth device may keep disconnecting. In this case, remove one of the older clients or change the automatic check interval (Check for new mail) from one minute to five minutes.
When the mailbox fills up or email goes to spam
The connection is fine, but email doesn't arrive or won't send. Two separate scenarios:
If you get "Mailbox is full" or "Quota exceeded," the problem isn't the settings; the mailbox quota is full. The guide Managing email quota; what to do when the mailbox fills up covers exactly this case. In Outlook, this error sometimes appears as "Cannot send or receive," and the user goes looking for a network problem.
If email is sent but lands in the recipient's spam, the problem isn't the connection; it's domain reputation. The SPF, DKIM, and DMARC records must be correct. The guide Why do our emails go to spam? explains this path step by step. One important point: don't send transactional email (passwords, invoices, order notifications) from shared hosting; there's a separate path for this, explained in the transactional email guide.
If you want to migrate the entire mailbox to another server, don't do it without IMAP; the correct method is in Migrating email with IMAP. And if you've just set up the email server, the webmail guide is a good starting point so that, before touching the client, you make sure the account is healthy on the server.
Which should I choose: IMAP or POP3?
Choose IMAP, with one specific exception: if your server mailbox space is low and you want to keep messages in a local archive and delete them from the server, POP3 with the "Leave a copy on server" option is reasonable for a short period. But for everyday work, IMAP. The cost is that server space is consumed and you have to manage the quota; that's it.
If you're on shared hosting and have a large number of high-volume mailboxes, you may need more space. ServerNet's Linux hosting is one of the options you can consider at this stage, but before any upgrade, first figure out which mailbox is eating the space.
To set up an autoresponder (for example, a vacation message), you don't need to open the client either; it's done from the control panel or webmail. The details are in Setting up an email autoresponder. More complete documentation is also available in the ServerNet knowledge base.
Frequently asked questions
Why does Outlook receive my email but not send it?
Almost always the SMTP settings are separate from IMAP, and the user has put the same incoming host for outgoing. Set the outgoing server to SMTP with port 465 (SSL/TLS) or 587 (STARTTLS) and turn on "My outgoing server requires authentication."
What's the correct port for setting up email on a phone?
For receiving with IMAP, use 993 with SSL/TLS, and for sending with SMTP, use 465 with SSL/TLS. If a network blocks 465, 587 with STARTTLS is the alternative. Don't choose port 25 for sending.
The password works in webmail but Outlook won't accept it, why?
Two-factor authentication is probably enabled, and Outlook needs an app password, not the main password. Create an App Password in the account's security settings and enter that in the client.
Should I get the incoming server from the domain's MX record?
Yes, if the domain's email is hosted on a separate service. The IMAP host must be the same place the MX record points to; otherwise the connection won't be established or the mailbox will appear empty.
Next step: check the server certificate once with openssl s_client, then compare the values in the table above with your client's current settings. In most cases, a single wrong port was the whole story.