An email server is a computer that stores your messages and moves them between you and the people you send to

When you send an email, it does not go directly from your computer to someone else's inbox. Instead, your message travels to a server — a machine that runs email software and stays connected to the internet all the time. That server holds your message, figures out where it needs to go, and hands it off to another server on the receiving end. The receiving server stores the message until the other person logs in and downloads it. Without servers, email would not work at all.

You interact with two kinds of email servers every time you check your messages. One handles sending (called SMTP), and one handles receiving and storing (called IMAP or POP3). Your email client — whether that is Gmail in a browser, Outlook on your computer, or an app on your phone — talks to both of these servers behind the scenes. You usually do not see this happening, but it is why you need server addresses and passwords in your email settings.

Key Takeaways

  • SMTP servers send your outgoing messages and require authentication to prevent spam.
  • IMAP and POP3 servers receive and store incoming messages, with IMAP keeping copies on the server and POP3 deleting them after read.
  • Your email client needs the correct server address, port number, and login credentials to connect to both sending and receiving servers.
  • Email servers run on specific ports (usually 25, 465, 587 for SMTP and 143, 993 for IMAP) that your client must match.

How SMTP servers handle outgoing mail

SMTP stands for straightforward Mail Transfer Protocol. When you write an email and hit send, your email client connects to an SMTP server and uploads your message. The SMTP server reads the recipient address, checks whether it recognizes the domain (the part after the @), and either delivers the message directly or passes it to another server that can.

SMTP servers require you to log in before they will send your message. This is a security measure called authentication. Without it, anyone could use the server to send spam or phishing emails. Your email provider — whether that is Gmail, Outlook, your company's mail system, or a third-party service — runs the SMTP server and checks your username and password before allowing the send.

The SMTP server also adds information to your message: a timestamp, the server's own name, and a unique identifier. This metadata helps the receiving server verify that the message is legitimate and not forged. If you are setting up email in a development environment or a custom process, you will need the SMTP server address (often something like smtp.gmail.com or smtp.company.com) and the port number it listens on — usually 587 for encrypted connections or 25 for unencrypted ones.

How IMAP and POP3 servers handle incoming mail

IMAP and POP3 are two different protocols for retrieving messages from a server. IMAP (Internet Message Access Protocol) keeps a copy of your messages on the server even after you read them. When you read an email on your phone and then open your laptop, the laptop can still see that message because IMAP syncs across devices. Your folders, flags, and read status all stay in sync too.

POP3 (Post Office Protocol version 3) downloads messages to your device and then deletes them from the server. This saves server storage space and is useful if you only check email from one device. Once you read a message with POP3, it lives on your computer or phone, not on the server anymore. If you lose that device, you lose the message unless you backed it up.

Most modern email setups use IMAP because it works better across multiple devices. The IMAP server address usually looks like imap.gmail.com or imap.company.com, and it listens on port 143 (unencrypted) or 993 (encrypted). Your email client needs to know this address and your login credentials to retrieve messages.

Why port numbers matter in email settings

A port is a numbered channel on a server. Think of it like a door number on a building — the server has many doors, and each one handles a different kind of traffic. Email servers listen on specific port numbers so your client knows which door to knock on.

SMTP typically uses port 587 (for encrypted, authenticated connections) or port 25 (for older, unencrypted connections). Some providers use port 465, which is an older encrypted standard that still works. IMAP uses port 143 or 993. POP3 uses port 110 or 995. If you enter the wrong port number in your email settings, your client will not be able to reach the server, and you will get a connection error.

The port number is tied to the type of encryption your connection uses. Port 587 and 993 use TLS (Transport Layer Security), which encrypts your password and messages while they travel to the server. Port 25 and 143 do not encrypt by default, which is why they are less common for personal email. Your email provider will tell you which port to use — it is always in their setup instructions.

The difference between your email provider and your email server

Your email provider (Gmail, Outlook, Yahoo, your company's IT department) owns and runs the email servers. You do not own the server or control it directly. You rent access to it by having an account. The provider maintains the hardware, keeps the servers running, backs up your messages, and handles security.

When you set up email in a client process, you are telling that process how to reach your provider's servers. You are not creating a server — you are connecting to one that already exists. If you are a developer building an process that needs to send email, you will either use your provider's SMTP server (if they allow it) or a third-party email service like SendGrid or Mailgun that runs SMTP servers for applications.

Common email server setup mistakes

The most frequent problem is using the wrong server address or port. Gmail's SMTP server is smtp.gmail.com on port 587, not smtp.gmail.com on port 25. Outlook's is smtp-mail.outlook.com. If you copy the address from the wrong source or mistype it, your email client will not connect.

Another common mistake is forgetting to enable "Less find app access" or creating an app-specific password. Gmail and Outlook require extra steps before third-party applications can connect to their servers. Gmail wants you to use an app password instead of your regular password. Outlook has similar requirements. Your email provider's documentation will explain what you need to do.

A third mistake is confusing IMAP and POP3. If you set up POP3 and then switch devices, your old messages will not appear on the new device because POP3 deleted them from the server. Switching back to IMAP will not recover them. Choose IMAP unless you have a specific reason to use POP3.

How encryption protects your email server connection

When your email client connects to a server, it can use encryption to scramble your password and messages so no one listening on the network can read them. TLS (Transport Layer Security) is the standard encryption method for email. It is the same technology that protects your banking website.

Most email providers require TLS for SMTP and IMAP connections. This means your password and messages are encrypted while traveling between your device and the server. Once the message reaches the server, the provider stores it (usually encrypted too, but that depends on their policy). The encryption only protects the journey, not the storage.

If you are setting up email in a development environment or custom process, always use the encrypted port (587 for SMTP, 993 for IMAP) unless the server explicitly does not support it. Unencrypted connections are a security risk and are increasingly blocked by providers.

Frequently Asked Questions

Can I run my own email server instead of using a provider?

Technically yes, but it is not practical for most people. Running your own server means buying hardware, keeping it online 24/7, managing security updates, handling spam filtering, and maintaining backups. Email providers do this at scale and handle the complexity. If you are a developer, you might run a mail server in a test environment, but for production use, a provider or third-party service is the right choice.

Why do I need both SMTP and IMAP if they are both email servers?

They do different jobs. SMTP is a one-way door for sending messages out. IMAP is a two-way door for retrieving and managing messages that came in. Your email client needs both to send and receive. Some older setups use POP3 instead of IMAP for receiving, but IMAP is standard now because it syncs across devices.

What happens if my email server goes down?

You cannot send or receive email until it comes back online. Your email client will show a connection error. Messages sent to you will queue up on other servers and try to deliver again later (usually for several days). Once your server is back up, those queued messages will arrive. This is why email providers use redundancy — multiple servers in different locations so one failure does not take down the whole system.

Do I need to know the server address if I use Gmail or Outlook in a web browser?

No. When you log into Gmail.com or Outlook.com in a browser, the website handles the server connection for you. You only need the server address and port if you are setting up email in a desktop client, a phone app, or a custom process. The browser version hides all of that.

Can someone hack my email by attacking the server?

Servers can be hacked, but your email provider invests heavily in security to prevent it. A stronger risk is someone guessing or stealing your password. Use a strong, unique password for your email account, and enable two-factor authentication if your provider offers it. That protects your account even if someone gets your password.