An SMTP server is the program that sends and relays outgoing email using the Simple Mail Transfer Protocol. Your mail client or website hands it a message; it looks up the recipient domain's MX record and delivers the message to that server, or to a relay that forwards it.
SMTP Defined: The Protocol That Sends Email
SMTP is a text conversation. The client says EHLO, names a sender and a recipient, sends headers and body, and the server answers with a three-digit code. It carries the message and its envelope addresses; it never decides whether the mail is read, because IMAP or POP3 does that.
- The client is your mail app, a website, or another mail server.
- The server is the MTA that queues, retries and reports failures.
- Every reply starts with 2 (accepted), 4 (retry later) or 5 (permanent failure).
On WebJi®, business email hosting on your own domain includes authenticated SMTP, so contact forms and mailboxes send from an address that can pass SPF and DKIM.
SMTP vs IMAP and POP3: Sending and Reading
SMTP sends mail out; IMAP and POP3 are how mail is read. A mailbox needs both directions: submission goes over SMTP, while the inbox syncs over IMAP on port 993 or downloads over POP3 on port 995.
The protocols also differ in shape. SMTP pushes a message between servers; IMAP keeps the mailbox on the server and syncs folders and read flags across devices; POP3 downloads messages and suits one device. The reading half is compared in the POP3 vs IMAP guide.
MX Records vs SMTP: Who Receives and Who Sends
An MX record names the servers that accept mail for a domain; SMTP is the conversation used to hand mail to them. Before connecting, the sending server asks DNS for the recipient domain's MX records and tries the host with the lowest priority number first.
That is why "SMTP server" and "mail server" are not interchangeable in a support ticket. Your MX record points at the inbound server, while your outgoing SMTP host is often a different hostname, the one your provider gives for submission. Editing the MX record changes who receives mail, not who sends it.
SMTP Ports: 25, 465 and 587 Explained
Port 587 is the standard for authenticated client submission with STARTTLS, 465 wraps the whole session in TLS, and 25 is server-to-server relay that most networks block for ordinary clients. Use 587 or 465 in a mail client.
| Port | Use | Encryption | Notes |
|---|---|---|---|
| 25 | Server-to-server relay | Opportunistic TLS | Blocked by most ISPs and office firewalls for clients |
| 465 | Client submission | Implicit TLS | Encrypted from the first byte; supported by every current client |
| 587 | Client submission | STARTTLS | The default choice for authenticated sending |
If webmail works and Outlook times out, the network is usually blocking 25 or the profile still uses it. Switch the client to 587 with STARTTLS and authentication, and the same mailbox works.
SMTP Authentication and TLS: What the Login Does
Authentication proves you are allowed to send through that server. The client sends AUTH PLAIN or AUTH LOGIN with the full email address as the username and the mailbox password, and a server that rejects it answers 535.
Accounts with two-factor sign-in usually need an app password for mail clients. TLS then encrypts the session: implicit on 465 from the first byte, negotiated by STARTTLS on 587 after the opening handshake. Sending on port 25 without a login is not available on shared hosting.
How an SMTP Relay Carries Mail to Another Domain
A relay is an SMTP server that accepts your message and forwards it toward the recipient instead of delivering it locally. It exists because an office connection or a website host often cannot reach port 25, and because a relay with an established IP has sending reputation a new domain lacks.
Relays still require authentication. An open relay that forwards mail from anyone is abused within days and lands on blocklists, so every legitimate relay asks for a username, an API key or an IP allowlist.
When delivery fails, the relay queues the message and retries with backoff. If the remote server keeps answering with a 4xx code for hours or days, the relay gives up and returns a bounce to the envelope sender.
SMTP in WordPress and PHP: Replacing mail()
PHP's mail() hands a message to the local mail transfer agent with no authentication and no reliable From address. On shared hosting that means contact forms that never arrive or arrive in spam, because the message carries no SPF alignment.
An SMTP plugin replaces mail() with an authenticated connection to your mailbox on port 587 or 465. Set the From address to the mailbox itself, since a mismatch between From and the authenticated user is a common cause of rejection. DNS records and the rest of the setup are covered in the business email setup guide.
Why SMTP Mail Lands in Spam: SPF, DKIM and DMARC
Receivers judge the sending domain, not only the words in the message. SPF lists the IP addresses allowed to send for the domain, DKIM signs each message with a key published in DNS, and DMARC tells the receiver what to do when either check fails.
Three fixes cover most cases: publish an SPF record that includes your relay, enable DKIM signing in the mail panel, and make the From domain match the authenticated domain. A PTR record that matches the sending hostname, plus a clean blocklist history, finishes the job.
Fixing Common SMTP Sending Failures
Most failures return one of five reply codes. Read the code before changing settings, because a 5xx is permanent and a 4xx asks for a retry.
| Code | What it means | Fix |
|---|---|---|
| 535 | Authentication failed | Use the full email address as the username, and an app password when 2FA is on |
| 550 | Recipient rejected or relay denied | Check the address, and make the From domain match the authenticated mailbox |
| 554 | Message blocked as spam | Fix SPF and DKIM, then remove links and attachments that trip filters |
| 421 | Too many connections or rate limited | Slow the sending rate, or move bulk mail to a relay |
| 552 | Message over the size limit | Compress the attachment, or send a download link instead |
A timeout with no code at all is usually port 25 blocked by the network, not a wrong password. Test 587 with STARTTLS before changing any credentials.
Frequently Asked Questions
What is an SMTP server?
It is the program that sends and relays outgoing mail over the Simple Mail Transfer Protocol. It takes a message from a client or website, resolves the recipient domain's MX record, and delivers to that host or to an authenticated relay.
Which port should I use for SMTP?
587 with STARTTLS for normal client submission, or 465 when the client supports implicit TLS only. Port 25 is for server-to-server relay and is blocked by most ISPs and office networks.
What is the difference between SMTP and IMAP?
SMTP sends mail out, while IMAP keeps the mailbox on the server and syncs it across devices. A mailbox uses both: SMTP to submit a message, IMAP to read what arrived.
Why do my SMTP emails go to spam?
Usually the sending domain fails SPF or DKIM, or the From address does not match the authenticated mailbox. Publish both records, enable DKIM signing, and send from the same domain you authenticate.
What is SMTP authentication?
A login proving you may send through that server, sent as AUTH PLAIN or AUTH LOGIN with your full address and password. Without it a server answers 535, or the network blocks port 25 altogether.
Can I use Gmail SMTP for my website?
Yes, with an app password and two-factor authentication enabled on the Google account. Its daily sending cap makes it a stopgap rather than a fit for a busy store's transactional mail.
Is WebJi® an Indian company?
Yes. WebJi® is headquartered in Jaipur, Rajasthan and has operated since 2005. Billing, support and governance all run from India.
Do you provide GST invoices?
Every purchase and renewal gets a GST invoice with our GSTIN, and hosting prices are quoted exclusive of 18% GST. Claim input credit as applicable.

