What Is SMTP and Which Settings Do You Need?
SMTP is the protocol that sends email. Understand how a message travels, which server, port, encryption and login settings you need, and how to fix send errors.
10 min readUpdated Nov 21, 2026By XPASS Editorial Team

Every time you press Send, a quiet chain of servers takes over. At the start of that chain is a protocol called SMTP. It is the reason mail leaves your phone or laptop, and it is also the reason many people see error messages such as "relay denied" or "authentication required" the first time they set up a business mailbox. This guide explains what SMTP does, follows one message from sender to recipient, lists the settings you need, and shows how to test and fix an outgoing mail setup without guesswork.
What SMTP is and what it is not
SMTP stands for Simple Mail Transfer Protocol. Its core specification is RFC 5321. In everyday terms, SMTP is the protocol that moves a message forward. It carries the message from your mail app to a mail server, and then from that server to the next server, until it reaches the server that holds the recipient's mailbox.
SMTP is about sending and relaying. It is not how you read mail. Reading uses IMAP or POP3, which fetch messages from your mailbox. If you are unsure which of those to use, the guide on IMAP vs POP3 explains the difference. A complete mail app setup always has both an incoming server and an outgoing SMTP server, and they are configured separately.

How a message travels
Following one message makes the settings easier to understand.
- You write and send. Your mail app connects to your outgoing server, called the submission server, and signs in.
- The server accepts the message. If your login is valid and the message is allowed, the server queues it.
- The server looks up the destination. It reads the domain after the at sign in the recipient's address and asks DNS for that domain's MX record, which names the receiving mail server.
- The server delivers the message. It connects to the receiving server and hands over the message with SMTP.
- The receiving server checks it. It may test SPF and DKIM, scan for spam and apply the recipient's rules before placing the message in a mailbox.
- The recipient reads it using IMAP, POP3 or webmail.
Your phone or laptop only does step 1. Everything else is done by servers. That is why a correct app setting is necessary but not sufficient: DNS records and server reputation also decide whether the message arrives and where it lands.
The settings you need
An outgoing mail setup normally asks for the following fields.
| Setting | What it means | Typical value |
|---|---|---|
| Outgoing server (host) | The name of the SMTP server | mail.yourcompany.com or a name from your provider |
| Port | The network port the server listens on | 587 or 465 |
| Encryption | How the connection is protected | STARTTLS on 587, SSL/TLS on 465 |
| Authentication | Whether you must sign in | On (required) |
| User name | The account that signs in | Full email address |
| Password | The mailbox password or an app password | As set by you or generated |
A few notes on each:
- Host. Use exactly the name your provider documents. Using a different name may cause a certificate warning because the name no longer matches the SSL certificate.
- Port. Port 587 is the standard for mail submission from clients, and port 465 is widely used for SSL/TLS submission. Port 25 is traditionally for server-to-server delivery, and many networks restrict it for ordinary users.
- Encryption. STARTTLS begins as a normal connection and upgrades to an encrypted one. SSL/TLS on port 465 starts encrypted from the first byte. Match the encryption type to the port.
- Authentication. Open relays that accept mail from anyone were abused for spam, so modern servers require you to sign in. This is the most common cause of "relay denied".
- User name. For business mailboxes this is almost always the full email address.
If you are adding the mailbox to a phone, the same values appear in the guides for Android and the iPhone, and you can copy them across.
Setting up SMTP in a mail app: a practical sequence
- Open the account settings in your mail app and find the Outgoing mail server or SMTP section.
- Enter the host name from your provider.
- Choose the port and encryption type as a matching pair: 587 with STARTTLS, or 465 with SSL/TLS, depending on what your provider documents.
- Turn on authentication and enter the full email address and password.
- Save, then send a test message to a personal address.
- Reply from the personal address to check the incoming side as well.
A simple example: Lina has created lina@greenfield.example. In her mail app she sets the incoming server as IMAP and the outgoing server as mail.greenfield.example, port 587, STARTTLS, with sign-in using her full address. She sends a test to her personal mailbox. It arrives, but in the spam folder. She realizes that the app settings are correct, and that the spam placement is about the domain's SPF and DKIM records. She reviews those next, rather than changing the SMTP port.
SPF, DKIM and DMARC: separate from your app settings
It is easy to blame SMTP settings for problems that actually live in DNS. Three records help receiving servers decide whether mail claiming to be from your domain is legitimate.
- SPF (RFC 7208) lists which servers are allowed to send mail for your domain.
- DKIM (RFC 6376) adds a cryptographic signature to outgoing messages that receiving servers can verify against a key published in DNS.
- DMARC tells receivers what to do when SPF and DKIM checks fail and gives you reporting.
If your messages send without any error but land in spam or get rejected, look at these records, not at the port number. A well-run business mailbox normally has all three configured for the domain, and your provider's documentation explains how.
Common errors and what to do
| Error or symptom | Likely cause | What to try |
|---|---|---|
| "Relay access denied" or "authentication required" | Authentication is off, or wrong credentials | Turn on sign-in; use full address and correct password |
| Connection timed out | Wrong host or port, or port blocked on the network | Verify host and port; try another network or the alternate port |
| Certificate or SSL error | Host name does not match the certificate | Use the exact host name from your provider |
| "Cannot send message" after the port was changed | Port and encryption not matching | Pair 587 with STARTTLS or 465 with SSL/TLS |
| Message accepted but never arrives | Recipient server rejected or delayed it | Check for a bounce message; review SPF, DKIM and DMARC |
| Message goes to spam | Sender authentication or content issues | Fix DNS records; review the message content |
| Attachment refused | Message too large for the server | Reduce the size or share a link |
| Sender address rejected | The "From" address does not belong to the signed-in account | Use the address that matches the mailbox |
When a message bounces, read the bounce text. It often contains a short code and a sentence explaining the reason. Codes starting with 4 usually mean a temporary problem and the server will retry. Codes starting with 5 usually mean a permanent rejection that needs a fix.
Sending from websites, printers and applications
SMTP is not only for people. Websites send order confirmations, printers email scanned documents and applications send alerts. Each needs the same fields: host, port, encryption, user name and password.
For these automated senders, take extra care:
- Use a dedicated mailbox for the application instead of a person's mailbox, so you can change the password without breaking someone's email.
- Store the password carefully in the application's secure settings, not in a shared document.
- Use encryption. Some older devices only support old encryption methods or none; if so, consider a safer route such as a relay service your provider recommends.
- Respect sending limits. Providers set limits to protect their reputation. Check the plan page for what applies instead of assuming.
- Keep the From address consistent with the domain you have authenticated using SPF and DKIM.
Submission, relay and the roles of each server
The words used around SMTP can be confusing, so here is a short glossary that makes error messages easier to read.
- Mail user agent (MUA). The program you use, such as a phone app, a desktop client or a website's mail function.
- Submission server. The server your program signs in to when it hands over a message. This is the server you configure in the app.
- Mail transfer agent (MTA). A server that accepts a message and passes it along to the next server. Your provider runs several of these behind the scenes.
- Relay. Passing a message through on behalf of someone else. A server should relay mail only for users who have signed in, which is why "relay denied" appears when authentication is off.
- Bounce. A message the system sends back to the sender when delivery fails permanently, normally with an explanation.
Knowing these terms helps you decide where to look. If the app cannot even connect, the problem sits between your program and the submission server: host, port, encryption or network. If the app accepts the message but the recipient never sees it, the problem is further along the chain, in DNS, authentication, or the recipient's own filters. Keeping that dividing line in mind saves a great deal of time when you troubleshoot.
Keeping outgoing mail safe
SMTP credentials are valuable to attackers because they allow spam to be sent in your name.
- Use a strong, unique password and enable multi-factor authentication when offered.
- Watch for unexpected bounce messages for mail you did not send. This can be a sign of misuse.
- Never send your password by email, and be wary of messages asking you to "verify your mailbox".
- Update devices and apps that hold SMTP credentials.
- Change the password after a lost device or a suspected leak.
Limits and what to watch for
- Correct SMTP settings do not ensure inbox delivery. The recipient's server makes the final decision, based on authentication, reputation and content.
- Providers set limits on message size, recipients per message and sending rate. Check your plan page rather than assuming.
- Port 25 is often blocked for ordinary users by home or mobile networks. Use the submission port your provider documents.
- A signature is not a setting. Your email signature is added by the mail app or the server. If you want a consistent, professional signature, see the guide to setting up a professional email signature.
- Alias and From addresses may be restricted. Some servers allow only addresses that belong to the account.
- Do not use SMTP to send unsolicited bulk mail. Follow the law that applies to you and your provider's acceptable use rules.
Summary
SMTP is the protocol that sends email: your app hands the message to an outgoing server, and servers pass it along until it reaches the recipient's mailbox. To use it you need a host name, a port, a matching encryption type, and sign-in details, usually your full email address and password. Pair port 587 with STARTTLS or port 465 with SSL/TLS, and always turn authentication on. When something fails, read the error: "relay denied" points to missing sign-in, timeouts point to a wrong host or blocked port, and messages that send but land in spam point to SPF, DKIM and DMARC rather than to the app. Test in both directions, protect the credentials, and keep records in DNS healthy. If you are setting up mailboxes for your own domain, you can see what is available on the Business Email page.
Frequently asked questions
What does SMTP stand for and what does it do?
SMTP stands for Simple Mail Transfer Protocol. It carries a message from your mail app to your outgoing mail server and then from server to server until it reaches the recipient's mail server. It handles sending, not reading.
What settings do I need to send email from a mail app?
You need the outgoing server host name, the port, the encryption type (SSL/TLS or STARTTLS), and the sign-in details, which are normally your full email address and password. Your provider's documentation lists the exact values.
Which SMTP port should I use?
Port 587 with STARTTLS is the usual choice for mail apps submitting messages, and port 465 with SSL/TLS is also widely used. Port 25 is mainly for server-to-server delivery and is often restricted for ordinary users. Follow your provider's instructions.
Why does my email say the relay was denied or authentication is required?
The outgoing server only accepts mail from signed-in users. Turn on authentication for the outgoing server, use the full email address as the user name, and check the password.
Do SPF and DKIM affect SMTP settings?
They are separate from your app settings. SPF and DKIM are DNS-based records that help receiving servers judge whether mail from your domain is legitimate. Correct SMTP settings let you send, while correct SPF and DKIM help the message reach the inbox.
References
About the author

Bob Kanokphon Thongdee
- Founder of XPASS VPN
- Co-founder of eSIMonline.asia
- More than 7 years in online marketing
- Founder of Cojourney Visa and Cojourney Travel
Want email on your own domain?
Business email with your domain name, priced per mailbox.
See business emailKeep reading

Business Email Guides
IMAP vs POP3: What Is the Difference and Which Should You Use?
IMAP keeps your mail on the server and in sync across devices, while POP3 usually downloads it to one device. Learn how they differ and how to choose.
10 min read

Business Email Guides
How to Set Up a Professional Email Signature
A good email signature tells people who you are and how to reach you without clutter. Here is what to include, how to build it, and how to roll it out to a team.
9 min read

Business Email Guides
How to Add Your Company Email to an Android Phone
A step-by-step guide to setting up a company mailbox on Android with IMAP and SMTP, including server fields, sync options, testing and troubleshooting.
10 min read