The Simple Mail Transfer Protocol (SMTP) is the standard for sending email. It defines how a program submits a message to a mail server and how mail servers pass messages on to each other. Retrieving and reading mail is handled by other protocols, such as IMAP or, with Exchange, Microsoft's own interfaces.
How does SMTP work?
An SMTP session is a simple text dialogue: the client introduces itself with EHLO, names the sender (envelope sender) with MAIL FROM, the recipients with RCPT TO, and transfers the actual message with DATA. To deliver a message to another domain, the sending server looks up the recipient domain's MX record in DNS and connects to the mail server listed there.
Ports: submission and relay
- Port 25: transfer between mail servers (relay). Encryption is negotiated via STARTTLS if both sides support it.
- Port 587 (submission): submission by authenticated clients; the connection starts unencrypted and is upgraded to TLS with STARTTLS.
- Port 465 (submissions): submission with implicit TLS – the connection is encrypted from the very first byte. RFC 8314 prefers this option for submission but recommends offering both ports during a transition period.
Relay, open relay and SMTP AUTH
A relay accepts mail and forwards it to other domains. That is intended – but only for authorized senders. An open relay forwards mail from anyone and is abused for spam within a short time; your IP address then ends up on block lists. Permissions are therefore controlled by allowed IP addresses or by SMTP AUTH, where the client signs in with a user name and password, Windows authentication or OAuth. Credentials should only be sent over an encrypted connection.
Why devices often need a relay
Multifunction printers, older business applications and monitoring systems often only speak plain SMTP – without modern sign-in and sometimes without current TLS. They frequently can no longer connect directly to Exchange Online or an internet mail server. A proven approach is an internal SMTP relay that accepts mail from devices on your own network and forwards it securely. For years many used the SMTP Server from IIS 6 for this, which Microsoft has deprecated. What that means and which alternatives exist is covered in our guide IIS SMTP Server deprecated. One option is our MailRelay, which takes over the IIS configuration, supports STARTTLS and implicit TLS, and delivers to Exchange Online via certificate, IP address or OAuth 2.0.
Best practice
- Allow relaying only for known IP addresses or authenticated senders – never open.
- Have clients submit over port 465 or 587 with TLS, not unencrypted over port 25.
- Maintain SPF, DKIM and DMARC for the sender domain so that mail reaches the recipient.
We help you set up mail sending for your devices and applications securely and traceably.


