How to Setup SMTP Relay in Office 365 (2024)

Sending emails from a scanner or web application can always be challenging. You don’t want to use a mailbox (with username and password) for this, but preferable an SMTP server that sends the mail for you. This is where we can use SMTP Relay in Office 365.

The problem with SMTP Authentication these days is that we want to use MFA on all our Office 365 accounts. When we create a dedicated mailbox for sending emails, we still can’t authenticate (and secure) it properly. This is also the reason that Microsoft doesn’t support SMTH AUTH anymore for new tenants created after 2020.

How to Setup SMTP Relay in Office 365 (1)

SMTP Relay, on the other hand, allows applications and devices to send email through your Exchange Online mail server. Protection is done based on your public IP Address(es), allowing only applications and devices from your network to use the SMTP Relay connection.

In this article, I will explain how you can set up an SMTP Relay in Office 365 and the difference between Direct Send and SMTP Relay.

SMTP Relay vs Direct Send in Office 365

Before we take a look at how to set up SMTP Relay in Office 365, I first want to explain to you the difference between SMTP Relay and Direct Send. Because both use the MX endpoint as an SMTP server address, but they both have their own use case.

Direct Send in Office 365 is used to deliver email to only your internal mailboxes. This means that you can’t scan a document and email it directly from the scanner to an external email address. You will need to scan it to your own mailbox, and in Outlook forward it to the external contact.

But the advantage is Direct Send is that you can use it also for third-party applications and it doesn’t require a static IP address for authentication.

SMTP Relay on the other hand can be used to send emails directly to external contacts, but only from networks (public IP addresses) that you have defined.

FeaturesDirect SendSMTP Relay
Send to internal recipientsYesYes
Send to external recipients NoYes
Support externally hosted applicationsYesNo
Required Network Port2525
Requires authenticationNoneBased on Public
IP Address

Set up SMTP Relay in Office 365

To set up an SMTP Relay we first need to know the public IP Address of the network where the device is located. If you want to use SMTP Relay for your local multifunctional (scanner), then just open the browser and visit myip.com. Note the IP Address, we will need that later.

  1. Open the Exchange Admin Center

    Log in add your Exchange Admin Center and navigate to:
    Mail flow > Connectors

    How to Setup SMTP Relay in Office 365 (2)
  2. Create a new Connector

    Click on Add a connector to create a new connector
    and choose Your organization’s email server

    How to Setup SMTP Relay in Office 365 (3)
  3. Connector name

    Give the connector a recognizable name and leave the selected options on.

    How to Setup SMTP Relay in Office 365 (4)
  4. Configure authentication

    The next step is to configure the authentication that we want to use. It’s possible to use a certificate for authentication, but more common is to do the verification based on the public IP Address of the device.

    You can define multiple IP Addresses for the connection (useful if you have different offices)

    How to Setup SMTP Relay in Office 365 (5)
  5. Review and create the connector

    The last step is to review your settings and create the connector. Double-check the IP Addresses and click on Create connector.

    How to Setup SMTP Relay in Office 365 (6)

To use the connector we will need to look up the MX record for your Office 365 tenant. The value of the MX record is used as SMTP Server Address in your device.

  1. Open the Microsoft 365 Admin Center
  2. Expand Settings and click on Domains
  3. Select your domain
  4. Click on DNS records
  5. Open the MX record (by clicking on it)
  6. Note to Points to address or value field
How to Setup SMTP Relay in Office 365 (7)

The format of the value is pretty standard:

# MX Record structure<your-domain>-<domain-extension>.mail.protection.outlook.com# For example:# lazyadmin-nl.mail.protection.outlook.com

Use this address in your scanner or application as SMTP Address.

Update your SPF Record

To prevent the mail from ending up in the spam folder, we will need to edit the SPF record. The SPF record identifies which endpoints (servers) are allowed to send emails on behalf of the domain.

By default your SPF Record looks like this:

v=spf1 include:spf.protection.outlook.com ~all

We are going to add our Public Ip Address to it:

v=spf1 ip4:10.11.12.13 include:spf.protection.outlook.com ~all# or for mutliple IP Addresses:v=spf1 ip4:10.11.12.13 ip4:20.21.22.23 include:spf.protection.outlook.com ~all

Keep in mind that DNS changes can take a couple of hours to apply. But after that, you should be able to send emails using your newly created SMTP Relay Connection.

Edit SMTP Relay Connection

You can use one SMTP Relay connection to send emails from multiple IP Addresses. So you don’t need to create a connection for each branch office that you have for example.

To add an IP Address to an existing connection, we can simply open an existing one:

  1. Click on the connection
  2. Click on Edit send email identity
  3. Add or remove IP Addresses from the connection
How to Setup SMTP Relay in Office 365 (8)

Using PowerShell to create SMTP Relay Connection

You can also use PowerShell to create an SMTP Relay connection in Office 365. This is especially useful when you need to create the same SMTP Relay connection in multiple tenants or if you just love to use PowerShell.

Make sure that you are connected to Exchange Online. You can read more about connecting to Exchange Online in this article.

There are a couple of parameters that we need to set:

ParameterDescription
NameThe name of the connector
ConnectorTypePartner: External partners or services.
OnPremises: Your on-premises email organization.
SenderDomainsUse * to allow all domains in your tenant
SenderIPAddressesYour public IP Address(es)
RestrictDomainsToIPAddressesSet to true to only allow connection from your sender IP addresses

You can find all parameters with their description in these Microsoft docs.

So to create the SMTP Relay connector in Office 365 with PowerShell we can use the following code:

New-InboundConnector -Name "SMTP Relay POSH" -ConnectorType = 'OnPremises' -SenderDomains * -SenderIPAddresses 10.11.12.13 -RestrictDomainsToIPAddresses $true

Or a bit more readable:

# Set the parameters$parameters = @{ Name = 'SMTP Relay POSH' ConnectorType = 'OnPremises' SenderDomains = '*' SenderIPAddresses = '10.11.12.13','20.21.22.23' RestrictDomainsToIPAddresses = $true}# Create the SMTP Relay connectorNew-InboundConnector @parameters

Wrapping Up

Keep in mind that you can’t SMTP Relay or Direct send for bulk emails. Microsoft applies reasonable limits to the connection and throttling to protect Microsoft 365 services.

Make sure that you configure the SPF records correctly because this will prevent your emails from ending up in the spam folder.

I hope you were able to create your SMTP Relay connection in Office 365 with this guide. If you have any questions, just drop a comment below.

How to Setup SMTP Relay in Office 365 (2024)

References

Top Articles
50+ Wedding Wishes for Your Sister - Funny, Heartfelt, and More
101 Heartfelt Happy 54th Anniversary Wishes For Her
Evil Dead Rise Review - IGN
Pwc Transparency Report
Used Trucks for Sale in Oneida, TN (with Photos)
monroe, LA housing - craigslist
T Mobile Rival Crossword Clue
Treasure Hunt Deals Racine Wi
Step 2 Score Release Thread
Who is on the FBI Most Wanted list cryptocurrency?
Basic Setup – OpenXR & Pimax HMDs...
Unveiling the Charm of Rio Vista, California
Amazon Ups Drop Off Locations Near Me
Bingo Bling Promo Code 2023
Two men arrested following racially motivated attack on Sanford teen's car
Craislist Vt
Oak Ridge Multibillion Dollar Nuclear Project: Largest Investment in Tennessee History
Www.patientnotebook.com/Prima
Warped Pocket Dimension
Six Broadway Wiki
Synergy Grand Rapids Public Schools
Mifflin County 24 Hour Auction
Enloe Bell Schedule
Simply Gorgeous! — Tecnam Completely Refreshed their Best-Selling Light-Sport Aircraft - ByDanJohnson.com
636-730-9503
Sweeterthanolives
-apostila-de-ingles-cn-epcar-eam-essa-eear-espcex-afa-efomm-en-e-ita-pr f3476c8ab0af975f02f2f651664c5f13 - Matemática
The Ultimate Guide To Beautiful Spokane, Washington
Beachbodyondemand.com
Hca Florida Middleburg Emergency Reviews
Busted Paper Haysi Regional Jail
Broyhill Gazebo Instructions
Jockey Standings Saratoga 2023
Express-Reisepass beantragen - hamburg.de
Goodwoods British Market Friendswood
9294027542
10 Best Laptops for FL Studio in 2023 | Technize
OSRS F2P Melee Combat Guide: Fastest Way From 1-99
Chihuahua Adoption in Las Vegas, NV: Chihuahua Puppies for Sale in Las Vegas, NV - Adoptapet.com
How To Use DeSmuME Emulator To Play Nintendo DS Games?
Filmy4 Web Xyz.com
Find your used roadbike, gravel Bike & MTB | buycycle UK
Vegan Eggplant Parmesan
Glowforge Forum
O'reillys Parts Store
Se compra un casoplón por un error de Crypto.com: le dieron 10 millones en vez de 100 dólares al pedir reembolso de criptomonedas
18K Gersc Stamped Inside Ring
Fapspace.site
Bòlèt New York Soir
new hampshire real estate - craigslist
Having A Short Temper Nyt Crossword Clue
Luxiconic Nails
Latest Posts
Article information

Author: Greg O'Connell

Last Updated:

Views: 5680

Rating: 4.1 / 5 (42 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Greg O'Connell

Birthday: 1992-01-10

Address: Suite 517 2436 Jefferey Pass, Shanitaside, UT 27519

Phone: +2614651609714

Job: Education Developer

Hobby: Cooking, Gambling, Pottery, Shooting, Baseball, Singing, Snowboarding

Introduction: My name is Greg O'Connell, I am a delightful, colorful, talented, kind, lively, modern, tender person who loves writing and wants to share my knowledge and understanding with you.