An SMTP server is the outgoing mail server. It takes the email you send and passes it on to the recipient's mail server. Your mail app hands each message to your provider's SMTP server (smtp.gmail.com for Gmail, for example), which looks up where the recipient's domain receives mail and delivers it there. SMTP stands for Simple Mail Transfer Protocol.
If you just need a server name, the settings for Gmail, Outlook.com, iCloud and Yahoo are in the table further down. Short definitions of the other terms used here are in our email glossary.
How an SMTP server sends your email
A sent message makes four stops:
- Your app to your provider's SMTP server. The app connects to the outgoing server in your account settings, usually on port 587 or 465, signs in and hands over the message. This step is called submission.
- Your provider looks up the recipient's domain. The SMTP server checks the domain's MX (mail exchanger) record in DNS to find the server that accepts mail for it.
- Server to server. Your provider's server connects to that receiving server, on port 25, and delivers the message. This step is called relay.
- The recipient reads it. The receiving server files the message in the mailbox. The recipient's app then fetches it with IMAP or POP, not SMTP.
SMTP only moves mail forward. Reading it is a separate job, which is why manual setup asks for both an incoming server (IMAP or POP) and an outgoing one (SMTP).
The standard for submission, RFC 6409, splits step 1 from step 3 on purpose: apps submit on port 587, and servers relay to each other on port 25. That lets providers require a login from apps while servers keep exchanging mail as before.
SMTP authentication: why the server asks for a password
An SMTP server that accepted mail from anyone would be an open relay that anyone could send spam through. So outgoing servers make you sign in first. RFC 6409 says a submission server rejects mail from a session that hasn't authenticated, with error 530.
How you sign in depends on the provider:
- Gmail: Google wants apps to use "Sign in with Google" and no longer supports apps that need you to share your Google username and password. If an app can't do that and you use 2-Step Verification, an app password is the fallback, though Google calls them unnecessary in most cases.
- Outlook.com: Microsoft requires modern authentication (OAuth2). Some apps and devices need an app password instead.
- iCloud Mail: apps other than Apple's need an app-specific password, and your Apple Account needs two-factor authentication to create one. Make it at account.apple.com under Sign-In and Security > App-Specific Passwords.
- Yahoo Mail: Yahoo's server settings page points you to its app password generator rather than your normal password.
The connection is encrypted as well. On port 587 the app starts in plain text and switches to TLS with the STARTTLS command. On port 465, TLS starts the moment the app connects. RFC 8314 asks servers and apps to support both, and either keeps your password and message off the wire in plain text.
SMTP server settings for Gmail, Outlook, iCloud and Yahoo
Checked on each provider's help page on 16 November 2026. Most apps fill these in for you when you add the account with the provider's own sign-in option. You only need them for manual setup. All four require authentication.
| Provider | SMTP server | Port and encryption | Sign-in |
|---|---|---|---|
| Gmail | smtp.gmail.com | 587 (STARTTLS) or 465 (SSL/TLS) | Sign in with Google, or an app password |
| Outlook.com, Hotmail, Live | smtp-mail.outlook.com | 587 (STARTTLS) | Microsoft sign-in (OAuth2); app password for some apps |
| iCloud Mail | smtp.mail.me.com | 587 (SSL; try TLS/STARTTLS if SSL fails) | Full iCloud address and an app-specific password |
| Yahoo Mail | smtp.mail.yahoo.com | 465 or 587 (SSL) | Full email address and an app password |
Work and school accounts can differ. Google says a Google Workspace account may need SMTP settings from its administrator, so ask your IT team before copying the Gmail row.
How to find your SMTP server
If the account already works in an app, the app has the server stored:
- Mail on Mac: choose Mail > Settings, click Accounts, select the account, then click Server Settings. The Outgoing Mail Server (SMTP) section shows the host name, the port and whether Use TLS/SSL is on.
- Classic Outlook for Windows: go to File > Account Settings > Account Settings, select the account, choose Server Settings, then Outgoing mail.
- Other apps: open the account's settings and look for "Outgoing server" or "SMTP".
For an account you haven't set up yet:
- Search your provider's help site for "SMTP settings" or "IMAP settings". Providers publish the server, port and encryption on one page; the four big ones are listed in the sources below.
- Email on your own domain through a web host: check the host's help pages or the email section of its control panel.
- Work email: ask your IT team, since company servers and sign-in rules vary.
Don't take the server name from the domain's MX record. MX points to the server that receives mail for the domain, which is often not the server you send through.
How to set up an SMTP server in an email app
- Add the account and pick the provider's own option if the app lists it (Google, Microsoft, iCloud, Yahoo). The app then sets the servers and handles sign-in.
- If your provider isn't listed, choose Other or IMAP and enter the incoming server first.
- For the outgoing server, enter the SMTP host name, port 587 with STARTTLS (or 465 with SSL/TLS), your full email address as the user name, and your password or app password. Make sure authentication is on.
- Send yourself a test message.
Running your own SMTP server is a different project. You need a server that can deliver on port 25, and many networks block it: Google Cloud, for instance, blocks outbound connections to port 25 "due to the risk of abuse". Your domain also needs sender authentication, since Gmail now requires SPF or DKIM from every sender, and SPF, DKIM and DMARC from anyone sending more than 5,000 messages a day to Gmail accounts. Most people who need to send from a website or app use a sending service's SMTP server instead.
Common SMTP errors and what they mean
These codes show up as an error in your app or inside a bounce message. The wording below is from Google's list of Gmail SMTP errors; other providers use the same numbers.
- 530 "Must issue a STARTTLS command first": the app connected without encryption. Turn on TLS/SSL, or STARTTLS on port 587.
- 535 "Username and Password not accepted": the password is wrong or out of date, or the provider wants its own sign-in or an app password.
- 550 5.1.1 "The email account that you tried to reach does not exist": check the recipient's address for typos.
- 552 5.3.4 "Your message exceeded Google's message size limits": the message is too big. Gmail's limit for attachments is 25 MB; share larger files as a link.
- 421 and 451 errors: temporary problems, such as a busy server or a sending rate limit. Your app keeps the message and tries again.
- Connection timed out, or can't connect to the server: the host name is wrong, or the network blocks the port. Office, hotel and public Wi-Fi sometimes block mail ports, so try 465 instead of 587 (or the reverse), or another network. On a Mac, our guide to Mac Mail not connecting to the server walks through the checks.
If a message leaves your outbox but comes back later, the bounce from "Mail Delivery Subsystem" carries the code; our guide to mailer-daemon bounce messages explains how to read one. On a Mac, see Apple Mail not sending emails, and if messages pile up unsent, emails stuck in the Mac Mail Outbox.
SMTP vs IMAP and POP
SMTP sends mail. IMAP and POP receive it. Every account set up by hand needs one of each: an outgoing SMTP server on port 587 or 465, and an incoming IMAP server (port 993) or POP server (port 995). IMAP keeps mail on the server and syncs it to every device; POP downloads it to one device. If your app can receive but not send, the incoming side is fine and the problem is in the SMTP settings.
FAQ
How do I find my SMTP server?
Look in your mail app's account settings for the outgoing (SMTP) server. In Mail on Mac it's under Mail > Settings > Accounts > Server Settings. For a new account, search your provider's help site for its SMTP settings: Gmail uses smtp.gmail.com, Outlook.com uses smtp-mail.outlook.com, iCloud uses smtp.mail.me.com and Yahoo uses smtp.mail.yahoo.com.
What is the SMTP server for Gmail?
smtp.gmail.com, on port 587 with STARTTLS or port 465 with SSL/TLS. Authentication is required. Google prefers apps that use Sign in with Google; an app password works if you use 2-Step Verification.
What port does SMTP use?
Mail apps send on port 587 (STARTTLS) or 465 (TLS from the start). Port 25 is for servers relaying mail to each other, and many networks block it for outgoing traffic.
Do I need an app password for SMTP?
It depends on the provider and the app. iCloud Mail needs an app-specific password in apps other than Apple's, and Yahoo points you to an app password. Gmail and Outlook.com prefer their own sign-in (OAuth) and only need an app password for apps that can't use it.
Is SMTP the same as IMAP?
No. SMTP sends mail from your app to the recipient's server. IMAP lets your app read and sync the mail that arrives in your mailbox. A manually set-up account needs both: an outgoing SMTP server and an incoming IMAP or POP server.
Sources
- IETF: RFC 6409: Message Submission for Mail
- IETF: RFC 8314: Use of TLS for Email Submission and Access
- IETF: RFC 5321: Simple Mail Transfer Protocol
- Google: IMAP, POP and SMTP for Gmail (developers)
- Google: Read Gmail messages on other email clients using POP
- Google: Add Gmail to another email client
- Google: Sign in with app passwords
- Google: Gmail SMTP errors and codes
- Google: Email sender guidelines
- Google: Gmail attachment size limits
- Google Cloud: Sending email from an instance
- Microsoft: POP, IMAP, and SMTP settings for Outlook.com
- Microsoft: Change or update email account settings in Outlook for Windows
- Apple: iCloud Mail server settings for other email client apps
- Apple: Sign in to apps with your Apple Account using app-specific passwords
- Apple: Change Server Settings in Mail on Mac
- Yahoo: IMAP server settings for Yahoo Mail