logo
search
Exchange Connection Problems

How to Configure Microsoft 365 SMTP Relay for Website Email

Nimra MalikNimra Malik Sep 28, 2026 869 views

Question details

Configure an Exchange Online SMTP relay so a website can send outgoing messages using a custom Microsoft 365 domain address.

How to Configure Microsoft 365 SMTP Relay for Website Email
Product
Microsoft 365 / Exchange Online
Device & OS
not provided
Scenario
Setting up a secure email routing connection for a website or web application to send automated emails using a Microsoft 365 custom domain.
Observed behavior
Creating a mail flow connector, locating the correct MX record for the SMTP server, and configuring SPF to ensure email deliverability.
Before you start

Ensure you have Exchange Administrator permissions in Microsoft 365 and obtain the static public IP address or TLS certificate details of the web server hosting your website.

Solution 1Recommended

Set Up SMTP Relay via Exchange Admin Center

Configure a mail flow connector using your static IP or certificate to relay emails securely from your website to Microsoft 365.

Microsoft 365 SMTP relay allows your web servers, applications, or multi-function devices to send emails using your custom domain. This method avoids the need for a licensed mailbox for the sender address, provided your domain is verified in the Microsoft 365 tenant.

1
Create a new mail flow connector

Log in to the Exchange admin center. In the left navigation menu, go to Mail flow > Connectors. Click on 'Add a connector' and select 'Your organization's email server' as the source.

2
Configure authentication settings

Give the connector a recognizable name and proceed to the authentication step. Choose to authenticate using a trusted TLS certificate or by entering the static public IP address of your web server. Review your settings and save the connector.

3
Locate your MX record

Open the Microsoft 365 admin center and navigate to Settings > Domains. Select your domain, then click on 'DNS records'. Find the MX record (e.g., yourdomain-com.mail.protection.outlook.com). This will serve as your SMTP server address.

4
Configure your website email settings

In your website or application's email configuration panel, enter the MX record address as the SMTP host. Set the SMTP port to 25 and disable SMTP authentication if relying on IP-based routing.

5
Update your SPF record

To prevent your relayed emails from being marked as spam, log in to your domain's DNS hosting provider. Update your domain's SPF record to include the public IP address of your web server (e.g., v=spf1 ip4:10.5.3.2 include:spf.protection.outlook.com ~all).

Set Up SMTP Relay via Exchange Admin Center
Deliverability Tip: It may take up to 24 hours for new DNS and SPF record changes to fully propagate across the internet. Test your email delivery after this propagation period.
Free Microsoft Office alternative

Enhance Your Workflow with WPS Office

While managing Microsoft 365 configurations like SMTP relays, you can streamline your daily document tasks with WPS Office. It provides a lightweight, free, and highly compatible alternative to Microsoft Office for writing server documentation, managing configuration spreadsheets, and creating presentations.

  1. 1. Download the software: Visit the official WPS Office website and download the free installer for your operating system.
  2. 2. Install WPS Office: Run the setup file and follow the quick on-screen instructions to install the suite on your device.
  3. 3. Start working instantly: Open WPS Office to immediately start creating or editing Word, Excel, or PowerPoint files without any compatibility issues.
Fully compatible with Microsoft Office formats including DOCX, XLSX, and PPTX.Lightweight installation that ensures fast performance without consuming massive system resources.Familiar and intuitive user interface allowing for a seamless migration from Microsoft Office.Completely free to use for your essential IT documentation and spreadsheet needs.
microsoft office alternative - wps office

Frequently Asked Questions

What port should I use for Microsoft 365 SMTP relay?

When configuring an SMTP relay utilizing an Exchange mail flow connector, you should configure your web server or application to route outgoing emails over Port 25.

Why are emails sent from my website going to the spam folder?

This typically occurs if your Sender Policy Framework (SPF) record is incorrectly configured. You must ensure that the static public IP address of your web server is explicitly added to the SPF record of your Microsoft 365 domain.

Do I need a paid Microsoft 365 license for the sender address when using SMTP relay?

No. When using an IP-based or certificate-based connector for SMTP relay, the specific sender email address does not require an active Exchange Online license, provided the domain used in the 'From' address is verified in your tenant.