
What an SMTP server is, which port and encryption to choose, how to set up sending from an email client, a website or an application, and how to fix common errors.
By Mouhamed BANKOLE, CEO at ITNET Technologies · Updated December 1, 2026 · Reading time: 11 min
Your contact form sends nothing, your invoices land in spam, or your software asks for an "SMTP server" you cannot find. The SMTP server is the piece that sends your emails, and a single wrong setting is enough to block them. This guide explains what an SMTP server is, which settings to enter (server, port, encryption, credentials), how to send from a website or application, which limits to respect and how to diagnose the most common errors.
In short
- An SMTP server is the server that sends your emails and passes them, server to server, to the recipient's mailbox.
- For an email client or a website, use port 587 (STARTTLS) or 465 (implicit TLS) with authentication; RFC 8314 recommends implicit TLS for submission (IETF).
- Port 25 is for server-to-server traffic, not for sending from a computer or an application.
- Gmail requires SPF or DKIM from all senders, and SPF, DKIM and DMARC from those sending 5,000 messages or more a day (Google).
- For a website, send through an authenticated SMTP relay rather than the server's default mail function.
Contents
- What is an SMTP server?
- How does sending an email over SMTP work?
- Which SMTP port should you choose: 25, 465 or 587?
- Which SMTP settings do you enter in an email client?
- How do you send emails from a website or application?
- What is an SMTP relay and when should you use one?
- Which rules must you follow for your emails to arrive?
- What are the sending limits of an SMTP server?
- How do you fix the most common SMTP errors?
What is an SMTP server?
An SMTP (Simple Mail Transfer Protocol) server is the server responsible for sending your emails and routing them to the recipient's mail server. The SMTP protocol, described in IETF RFC 5321, only handles sending and relaying; reading messages relies on other protocols.
The roles not to confuse:
- SMTP: sends and relays messages, from your software to the server, then from server to server;
- IMAP: syncs your inbox across all your devices, as our article on IMAP vs POP explains;
- POP3: downloads messages to a single device, usually without keeping them on the server;
- webmail: a web interface that uses these same protocols behind the scenes.
In practice, when you set up an address in Outlook, Thunderbird or on a smartphone, you always enter two servers: an incoming server (IMAP or POP3) and an outgoing server (SMTP).
How does sending an email over SMTP work?
Sending an email takes three steps: your software hands it to your SMTP server, which looks up the recipient's server in the DNS, then delivers it there. The recipient's server then files the message in the right mailbox.
A message's journey, step by step:
- Submission: your software connects to your SMTP server, authenticates with your username and password, then hands over the message.
- Recipient lookup: the server reads the MX record of the recipient's domain in the DNS to know which server to contact.
- Relay: your server connects to the recipient's server and passes the message on, preferably over an encrypted connection.
- Checks on arrival: the recipient's server checks authenticity (SPF, DKIM, DMARC), the sender's reputation and the content.
- Delivery: the message lands in the inbox, in spam, or is rejected with an error code sent back to the sender.
That is why an email can leave your side successfully and never arrive: the final decision belongs to the recipient's server.
Which SMTP port should you choose: 25, 465 or 587?
To send from software, a website or an application, choose port 465 (implicit TLS) or 587 (STARTTLS), always with authentication; port 25 is reserved for server-to-server traffic. IETF RFC 8314 now recommends implicit TLS, on port 465 by default, for message submission (IETF).
| Port | Use | Encryption | When to use it |
|---|---|---|---|
| 25 | Relay between mail servers | Optional STARTTLS | Never from software or a website: often blocked outbound |
| 465 | Authenticated submission | TLS from the start (implicit TLS) | Recommended choice for software or an application |
| 587 | Authenticated submission | STARTTLS (upgrade to encryption after connecting) | Standard alternative, very widely supported |
| 2525 | Unofficial fallback port | Depends on the provider | Only if your provider offers it and the others are blocked |
What to remember about ports:
- port 587 is the submission port defined by RFC 6409;
- port 465 encrypts the connection from the very start, so a misconfiguration cannot send your credentials in clear text (IETF);
- port 25 is often blocked outbound by Internet providers and hosting companies to curb spam;
- encryption must match the port: "SSL/TLS" with 465, "STARTTLS" with 587, otherwise the connection fails.
Which SMTP settings do you enter in an email client?
An email client needs five SMTP settings: the outgoing server name, the port, the encryption type, the username and the password. Your email provider lists them in its customer area or documentation.
The settings to fill in:
- SMTP server: a host name such as
smtp.your-provider.tld, supplied by your email service; - port: 465 or 587, as in the table above;
- encryption: SSL/TLS for port 465, STARTTLS for port 587;
- authentication: enabled, usually with the same username as for incoming mail;
- username: generally your full email address;
- password: the mailbox password, or an app password if two-factor authentication is on.
Pro tip: if sending fails while receiving works, first check the "my outgoing server requires authentication" option: it is the most common oversight in Outlook and on smartphones.
With Wayhost professional email, your addresses use your own domain name, and the product page states activation within minutes, with no technical skills required (checked on December 1, 2026). Our professional email guide compares the options.
How do you send emails from a website or application?
For a website to send reliable emails (forms, orders, password resets), configure it to go through an authenticated SMTP server rather than the server's default mail function. Messages then leave from a server recognised for your domain, which greatly improves their chances of arriving.
The steps for a WordPress site:
- Create a dedicated address for sending, for example
notifications@yourdomain.com. - Install a reputable SMTP plugin from the official WordPress directory.
- Enter the SMTP settings: server, port 465 or 587, encryption, username and password.
- Use the same address as the sender ("From" field) as the one that authenticates.
- Send a test email to a Gmail address and an Outlook address, then check it reaches the inbox.
For an application (PHP, Node.js, Python), the principle is the same: a mail library receives the host, port, encryption and credentials, ideally stored in environment variables rather than in the code. Our WordPress hosting guide covers the other site settings, and Wayhost web hosting can host the site itself.
Pro tip: never store the SMTP password in clear text in a versioned file (Git repository). If it leaks, a spammer can send thousands of messages in your name and wreck your domain's reputation.
What is an SMTP relay and when should you use one?
An SMTP relay is a service that sends your emails on your behalf, from servers with a monitored reputation, to improve deliverability. Your website, application or server hands it messages over authenticated SMTP, and the relay delivers them to recipients.
When to use a relay:
- your site sends transactional emails (orders, invoices, sign-ups) whose delivery is critical;
- you run a VPS and do not want to manage its IP address reputation yourself;
- you send large volumes, newsletters included, and want delivery statistics;
- your hosting provider blocks port 25 outbound, which prevents sending directly from the server.
Running your own sending server on a VPS remains possible, but you then have to handle reverse DNS, blocklists and IP reputation, requirements Google details for any server that sends to Gmail (Google).
Which rules must you follow for your emails to arrive?
For your emails to arrive, authenticate your domain (SPF, DKIM, DMARC), send over an encrypted connection and from an IP address properly declared in the DNS. Gmail has enforced these rules since 2024 for all mail sent to personal Gmail accounts (Google).
Gmail's requirements, which most major providers also apply:
- authentication: SPF or DKIM for all senders, SPF, DKIM and DMARC for those sending 5,000 messages or more a day (Google);
- a DKIM key of at least 1,024 bits, with 2,048 bits recommended (Google);
- a TLS connection to transmit emails, a requirement added in December 2023 (Google);
- valid reverse DNS: the sending IP address must have a PTR record pointing to a host name that itself resolves to that address (Google);
- one-click unsubscribe for marketing messages above 5,000 sends a day (Google).
These records are created in your domain's DNS zone, for example with Wayhost DNS. Our guides to DKIM and SPF and DMARC cover each record, and our article on spam email helps fix a deliverability problem.
What are the sending limits of an SMTP server?
Every SMTP server applies sending limits (messages per hour or per day, recipients per message) to prevent spam, and exceeding them leads to temporary rejections or an account block. These caps vary by provider and plan: always check the documentation before a bulk send.
The most common limits:
- number of messages per hour or per day and per mailbox;
- number of recipients per message ("To", "Cc" and "Bcc" fields combined);
- maximum size of a message, attachments included;
- recipient-side thresholds: Gmail applies stricter requirements from 5,000 messages a day to its accounts (Google).
A standard business mailbox is fine for everyday exchanges and a website's notifications. For a newsletter to several thousand contacts, use a relay or a dedicated sending platform: you protect the reputation of the address you use every day.
How do you fix the most common SMTP errors?
SMTP errors almost always come from a mismatched port and encryption, rejected authentication, a blocked port or a poorly authenticated domain. The code returned by the server points you in the right direction.
| Symptom or code | Likely cause | Fix |
|---|---|---|
| Connection timed out | Port blocked by the network or the host | Try 465 or 587, check the firewall |
| Certificate or TLS negotiation error | Encryption does not match the port | SSL/TLS with 465, STARTTLS with 587 |
| "535 Authentication failed" | Username or password rejected | Full address, app password if two-factor is on |
| "Relay access denied" | Sending without authentication | Enable SMTP authentication |
| "5.7.26" at Gmail | Unauthenticated message | Set up SPF and DKIM, then DMARC (Google) |
| Message sent but received as spam | Reputation, content or domain alignment | Check SPF, DKIM, DMARC and the "From" domain |
To test an SMTP connection from a Linux server, the command openssl s_client -connect smtp.your-provider.tld:465 shows whether the TLS negotiation succeeds. Replace the name with your provider's.
Frequently asked questions
What is the difference between SMTP and IMAP?
SMTP sends emails, IMAP reads them and syncs them across your devices. An email client therefore needs both: an outgoing SMTP server and an incoming IMAP server. They are two separate servers, even if their names are often similar.
What is the best SMTP port?
Port 465, with implicit TLS, is the choice recommended by RFC 8314 for sending from software (IETF). Port 587 with STARTTLS remains a standard and very common alternative. Avoid port 25, which is reserved for server-to-server traffic and often blocked.
Where do I find my SMTP server address?
It is listed in your email provider's customer area or documentation, next to the IMAP settings. It usually takes the form smtp. followed by the provider's domain. If you use a professional email service, your provider can also give it to you.
Can I use Gmail's SMTP server for my website?
It is technically possible with a Google account and an app password, but it is not suited to a business website. The sender stays tied to Gmail rather than to your domain, and the allowed volumes are limited. An address on your own domain, authenticated with SPF and DKIM, is more reliable.
Why do emails sent from my website land in spam?
Most often, the site sends without SMTP authentication or from an address whose domain is not authenticated. Set up sending through an authenticated SMTP server and publish SPF, DKIM and DMARC for your domain. Also check that the "From" address really belongs to that domain.
Should you run your own SMTP server?
It is only worthwhile if you have solid administration skills and a real need for control. You have to manage security, IP reputation, reverse DNS and blocklists. For most businesses, professional email or an SMTP relay is simpler and more reliable.
Is SMTP encrypted?
It can be: with port 465 or 587 and the right setting, the connection between your software and the server is encrypted with TLS. Between servers, encryption depends on both sides, and Gmail now requires it to accept messages (Google). The content remains readable by the servers themselves, unless you use end-to-end encryption.
How many emails can you send per day over SMTP?
It depends on your provider and plan, which set a cap per hour or per day. Beyond it, sends are temporarily rejected, or the account may even be suspended. For high volumes, use an SMTP relay or a dedicated sending platform.
Key takeaways
- The SMTP server sends your emails, while IMAP or POP3 is used to receive them.
- Use port 465 or 587 with authentication, and the encryption that matches the port.
- A website must send through authenticated SMTP, never through the server's default mail function.
- SPF, DKIM and DMARC are essential for your messages to reach Gmail and the others.
- Respect sending limits and hand large volumes to a dedicated relay.
To send from addresses on your own domain name, without configuring a server yourself, discover Wayhost professional email.
Article written by Mouhamed BANKOLE, CEO at ITNET Technologies.


