To set the outgoing mail server on an iPhone, open Settings > Apps > Mail > Mail Accounts (on iOS 17 and earlier, Settings > Mail > Accounts), tap the email account, tap Account, then tap SMTP under Outgoing Mail Server. Tap the Primary Server and enter the host name, user name, password and port that your email provider gives you, then tap Done.
You’ll only see these settings for IMAP and POP accounts, such as email from your website host, internet provider or a work server. iCloud, Gmail, Outlook.com, Yahoo and Exchange accounts added with their own buttons are configured automatically. Below are the full steps, the settings for popular providers, and fixes for the “Cannot Send Mail” error.
What you need from your email provider
Find your provider’s SMTP (outgoing mail) settings in their help pages or your hosting control panel. You’ll need:
- Host name: the server address, such as smtp.yourdomain.com or mail.yourdomain.com
- User name: usually your full email address
- Password: your email password, or an app password for providers that require one
- Port: typically 587 or 465
- SSL: whether the connection is encrypted (it almost always should be)
How to change the outgoing mail server on an iPhone
- Open the Settings app.
- Tap Apps, then Mail. On older versions of iOS, tap Mail directly.
- Tap Mail Accounts (or Accounts) and choose the email account.
- Tap Account at the top to open the server settings.
- Scroll to Outgoing Mail Server and tap SMTP.
- Under Primary Server, tap the server name.
- Make sure Server is turned on, then fill in Host Name, User Name and Password.
- Turn on Use SSL, set Authentication to Password, and enter the Server Port.
- Tap Done. The iPhone checks the settings and saves them if they work.
Add a backup outgoing server
On the SMTP screen, the Other SMTP Servers section lists servers from your other accounts. Tap Add Server to add another one. If the primary server fails, Mail tries the other servers that are turned on.
Be careful with this. Sending through a different provider’s server can make your mail look suspicious to spam filters, and some providers won’t send mail for addresses they don’t host.
SMTP settings for common providers
If you added one of these as an “Other” account instead of using its built-in option, these are the standard outgoing settings. Check with your provider if they don’t work, as settings can change.
| Provider | Host name | Port | Notes |
|---|---|---|---|
| Gmail | smtp.gmail.com | 587 or 465 | Use an app password if you have 2-Step Verification |
| Outlook.com / Hotmail | smtp-mail.outlook.com | 587 | Adding it with the Outlook.com button is easier |
| Yahoo Mail | smtp.mail.yahoo.com | 465 or 587 | Requires an app password |
| iCloud Mail | smtp.mail.me.com | 587 | Requires an app-specific password |
| Web hosting email | Usually mail.yourdomain.com | 465 or 587 | Check your host’s email settings page |
Port 25 is often blocked by mobile carriers and home internet providers, so avoid it unless your provider specifically tells you to use it.
What port should I use for outgoing mail on an iPhone?
Use 587 or 465 with SSL turned on, depending on what your provider lists. Port 587 is the most common.
Fix “Cannot Send Mail” or “The connection to the outgoing server failed”
- Check the password. A changed email password is the most common cause. Re-enter it in the SMTP Primary Server screen, and in the incoming server settings too.
- Use an app password. Gmail, Yahoo and iCloud reject your normal password in third-party mail settings when two-factor authentication is on.
- Try the other port. Switch between 587 and 465 with SSL on.
- Check the host name for typos. One wrong letter is enough to block sending.
- Switch networks. Try Wi-Fi instead of cellular, or the reverse, in case one network blocks mail ports.
- Check the Outbox. Open Mail, tap Mailboxes, and look for an Outbox. Messages that didn’t send wait there and go out once the server works.
- Remove and re-add the account. As a last resort, delete the account and add it again, using the built-in provider option if there is one.
Do I need to set the outgoing server again after changing my password?
Yes. The SMTP server keeps its own password. Update it in the Primary Server screen as well as the account’s main password.
IMAP, POP and the outgoing server
The incoming server (IMAP or POP) is how your iPhone receives mail, and the outgoing SMTP server is how it sends. They’re set separately, which is why mail can arrive fine while sending fails. If you’re setting up a new account and can choose, pick IMAP for incoming mail, so messages stay in sync between your iPhone and computer.
Related: change the default email account on an iPhone.
Related: why there’s no option to change your email password on an iPhone.

Kermit Matthews runs Live2Tech from just outside Philadelphia. He is an IT specialist with over 20 years of experience, from a university help desk to small-business IT, IT management and his own consulting practice, and has written tech guides full time since 2020. Steps are checked against the current software on a real device or the maker’s official documentation. More about Kermit.