At a glance. Standard ports: 587 (STARTTLS), 465 (implicit TLS) · Port 25: Server to server, often blocked · MigoSMTP relay: smtp.migosmtp.com:587 · Note: Check provider limits before use
The short version
- What an SMTP server does. SMTP stands for Simple Mail Transfer Protocol.
- The settings you will be asked for. Almost every application that sends mail asks for the same five things: a host name, a port, a security mode, a username and a password.
- Ports: 587, 465, 25 and 2525. Port 587 is the standard submission port.
- Testing a connection from the command line. Before you blame the application, check that the server is reachable and speaks TLS.
- Using your mailbox provider as an SMTP server. Gmail and Microsoft 365 both let you send through their SMTP servers, and for a handful of messages from a personal tool that is fine.
- When you need a sending service. A sending service, also called an SMTP relay or a transactional email provider, gives your application an SMTP endpoint and an API, and runs the infrastructure that makes delivery reliable: reputation management, feedback loops, bounce handling, suppression lists and logs.
What an SMTP server does
SMTP stands for Simple Mail Transfer Protocol. An SMTP server accepts a message from a sender, works out where the recipient's mail is hosted by looking up the MX record for their domain, and hands the message over to that destination. When you press send in an email app, or when a web application sends a password reset, an SMTP server is doing the work.
There are two jobs that people often mix up. Sending mail is done over SMTP. Reading mail, in an app or webmail, uses other protocols such as IMAP. When a settings screen asks for an "outgoing server", it wants the SMTP server.
The settings you will be asked for
Almost every application that sends mail asks for the same five things: a host name, a port, a security mode, a username and a password. The host name belongs to your provider. The username and password are credentials created for your account, and for a sending service they are usually separate from your login to the dashboard.
Keep credentials out of your source code. Put them in environment variables or a secrets manager, and create one set per application so you can revoke a single one without breaking everything else.
Ports: 587, 465, 25 and 2525
Port 587 is the standard submission port. The connection starts in plain text and upgrades to an encrypted one with STARTTLS. Port 465 starts encrypted from the first byte, which is called implicit TLS, and it is widely supported again. Port 25 is for server-to-server delivery and is commonly blocked by cloud hosts and home connections to limit spam. Port 2525 is not an official standard, but some providers offer it as an alternative when 587 is blocked.
If a connection times out, the usual cause is a firewall or a hosting provider that blocks the port, not a wrong password. Test from the same machine that will send, not from your laptop.
Testing a connection from the command line
Before you blame the application, check that the server is reachable and speaks TLS. This command connects to a submission port and prints the certificate and the server's greeting. Replace the host with your provider's.
openssl s_client -starttls smtp -connect smtp.example.com:587
A successful result shows a certificate chain and a line beginning with 220. If you see a timeout, the port is blocked. If you see a certificate error, check the host name you typed.
Using your mailbox provider as an SMTP server
Gmail and Microsoft 365 both let you send through their SMTP servers, and for a handful of messages from a personal tool that is fine. They are built for people, not for applications. Google documents daily sending limits for personal and Workspace accounts, and Microsoft applies its own limits and has been phasing out basic username and password sign-in for SMTP. Check each provider's current documentation before you rely on either.
The larger problem is what you lose. A mailbox provider gives you little delivery reporting, no per-message logs you can search, and no way to separate marketing from transactional mail. If a message does not arrive, you have no trail to follow.
When you need a sending service
A sending service, also called an SMTP relay or a transactional email provider, gives your application an SMTP endpoint and an API, and runs the infrastructure that makes delivery reliable: reputation management, feedback loops, bounce handling, suppression lists and logs. You pay for volume and features instead of running servers.
Choose one when email matters to your business, for example passcodes, receipts and order updates, or when you send more than a few hundred messages a day. The next section lists what to compare.
What to compare before you choose
Look at how the price scales with your real monthly volume, not the headline plan. Check which ports are supported, whether you get an API as well as SMTP, how long logs are kept, whether you can use a dedicated IP, and how support works when something goes wrong at an awkward hour.
If you invoice in rupees, ask whether the provider bills in INR and issues GST invoices. For senders in the UK and EU, ask about data processing terms. Our own plans, ports and billing are on the pricing page, and our guide for Indian senders covers the practical side.
Common SMTP errors and what they mean
SMTP replies are three-digit codes. Codes starting with 2 mean success, 4 means a temporary problem and the sender should retry, and 5 means a permanent failure. A 535 reply means authentication failed, so check the username and password, and whether the account needs an app-specific password. A 550 reply usually means the recipient's server rejected the message or the address does not exist.
A 421 or 450 reply means the receiving server asked you to try later, often because of rate limiting. A timeout points to a blocked port. A TLS handshake error often means the wrong security mode for the port, for example STARTTLS on 465. Our free bounce code lookup explains the longer enhanced codes that follow.
Security basics
Always use an encrypted connection. Never send credentials over a plain connection on any port. Use a unique credential for each application, store it as a secret, and rotate it if a developer leaves or a server is retired.
Restrict who can use your account where you can, for example by limiting API key permissions. Watch your sending logs for volume you did not expect, which is often the first sign of a leaked credential.
Whichever server you use, authenticate your domain
An SMTP server can deliver your message, but mailbox providers decide whether to trust it. Publish SPF and DKIM for your domain and add a DMARC record, so Gmail, Outlook and Yahoo can see that the mail really comes from you. Without them, even a good provider's mail can land in spam or be rejected.
Our setup guide walks through each record, and the free checker tells you what is missing on your domain right now.
Further reading and sources
- RFC 5321: Simple Mail Transfer Protocol
- RFC 6409: Message Submission for Mail
- RFC 8314: Cleartext Considered Obsolete: TLS for email submission
Related guides and tools
- DKIM, SPF and DMARC setup: Authenticate your domain end to end.
- Check SPF, DKIM and DMARC: Test your domain's records.
- Sending email from India: INR billing, GST invoices and UPI.
- Bounce code lookup: Decode SMTP and enhanced status codes.
Ready to try it? Start on the free plan and send your first message in minutes.
Frequently asked questions
What is an SMTP server?
An SMTP server is a program that accepts email from a sender and passes it on toward the recipient using the Simple Mail Transfer Protocol. Your mail client or application hands the message to it, and it delivers the message to the recipient's mail server.
Which SMTP port should I use?
For sending from an application or mail client, use port 587 with STARTTLS or port 465 with implicit TLS. Port 25 is for server-to-server delivery and is often blocked on consumer and cloud networks.
Do I need my own SMTP server?
Not usually. Running one means managing IP reputation, authentication, queues and abuse handling. Most teams send through a provider's SMTP relay instead and keep their own server out of the delivery path.
Is an SMTP server the same as a mail server?
Not exactly. SMTP handles sending and relaying. A full mail server usually also stores mailboxes and lets users read mail, which is done with other protocols such as IMAP.