Every time you hit send on an email, a background process kicks in that most people never think about. That process runs on SMTP, the protocol responsible for getting your message from your outbox to your recipient's inbox. If you manage email through your Avalon Hosting account, understanding the basics of SMTP will make it much easier to configure your mail client correctly and troubleshoot delivery problems when they come up.
What SMTP actually does
SMTP stands for Simple Mail Transfer Protocol. It's a set of rules that governs how a sending mail server hands off a message to a receiving mail server. Importantly, SMTP only handles the sending side of email. Reading or downloading messages from a mailbox is a separate job handled by protocols like IMAP or POP3.
SMTP is responsible for three things: formatting and addressing your outgoing message correctly, routing it to the right destination server, and reporting back with an error if delivery fails along the way.
How an email actually travels
When you click send, a fairly precise sequence of events happens behind the scenes:
- Connection: Your email client or hosting account's mail server opens a connection to the outgoing SMTP server.
- Greeting: The sending server introduces itself with a command (EHLO), and the receiving server responds with the features it supports.
- Sender and recipient: The sending server specifies who the message is from and who it's going to.
- Authentication: If the server requires login credentials, they're verified at this stage before anything else proceeds.
- Message transfer: The actual subject, body, and any attachments are transmitted, and the receiving server confirms receipt with a status code.
- Delivery: The receiving server looks up the destination domain, runs spam and virus checks, and drops the message into the recipient's mailbox.
- Session close: The connection ends cleanly once the message has been handed off.
If any step fails, the server responds with a numeric status code that tells you exactly what went wrong, which is invaluable when you're troubleshooting a bounced message.
Outgoing vs. incoming mail servers
SMTP servers play two different roles depending on which side of the conversation they're on:
- Outgoing server: Accepts mail from your client, validates your login, and routes it toward its destination based on DNS records. It also queues and retries delivery if the destination is temporarily unreachable.
- Incoming server: Accepts messages arriving from other servers, runs them through spam and authentication checks, and places accepted mail into the correct mailbox.
How SMTP stays secure
The original SMTP protocol wasn't built with today's security threats in mind, so modern email relies on a few additions layered on top of it:
- Encryption: Most connections today are encrypted using TLS, typically over port 587 (STARTTLS) or port 465 (SMTPS), so message content can't be read in transit.
- SPF: A DNS record listing which servers are allowed to send mail for your domain.
- DKIM: A digital signature added to outgoing messages that proves they weren't altered in transit.
- DMARC: A policy that tells receiving servers what to do if SPF or DKIM checks fail.
Common questions
Does SMTP also receive my email? No. SMTP only sends and relays mail. Retrieving messages from your mailbox is handled by IMAP or POP3.
Which port should I use? For sending mail from a client, port 587 with STARTTLS is the modern standard. Port 465 (SMTPS) is also widely supported. Port 25 is reserved for server-to-server relay and is usually blocked for outbound client connections.
Why did my email bounce even though my settings look right? The status code returned by the server almost always tells you why. A temporary code usually means the receiving server is busy; a permanent code usually points to an address or configuration problem.