> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.spreadly.app/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to Set Up Server-Side Email Signatures for Microsoft 365 / Exchange Online

Server-side email signatures add your Spreadly signature to outgoing mail from Microsoft 365, so every sender gets the same signature on every device without installing anything. This article shows you how to send outbound mail from Exchange Online to Spreadly, accept the mail coming back, and add the header Spreadly needs. When you're done, every outgoing email from your verified domains carries the signature.

**Before you start**
- You need an **Exchange Administrator** or **Global Administrator** account in Microsoft 365.
- Your sending domain must be verified in Spreadly. See [How to add and verify domains](https://help.spreadly.app/en/article/setup-domains-gxztts/).
- Keep your Spreadly team token ready. You'll paste it into a mail flow rule.
- You find all values for this setup in Spreadly under **Email Signature** > **Install / Setup**. Select **Microsoft 365** and **Server side (Beta)**.


| Changes in Exchange Online can take up to 30 minutes.


## Create the Connector to Spreadly


1. Go to the [Exchange admin center](https://admin.exchange.microsoft.com) and sign in with your admin account.
2. Go to **Mail flow** > **Connectors** and click **Add a connector**.
3. Under **Connection from**, select **Office 365**. Under **Connection to**, select **Your organization's email server**. Click **Next**.
4. Enter `Spreadly` in the **Name** field. Keep **Turn it on** checked and uncheck **Retain internal Exchange email headers**. Click **Next**.
5. Select **Only when I have a transport rule set up that redirects messages to this connector**. Click **Next**.
6. Enter `mx-sig.spreadly.app` as the smart host, click **+** to add it, and click **Next**.
7. Keep **Always use Transport Layer Security (TLS) to secure the connection** checked and select **Issued by a trusted certificate authority (CA)**.
8. Check **And the subject name or subject alternative name (SAN) matches this domain name**, enter `mx-sig.spreadly.app`, and click **Next**.
9. Enter an email address of your organization, click **+**, and click **Validate**.


| The test email fails, because it has no team token. This is expected. Only the connection test has to succeed.


10. Click **Next**, then click **Create connector**.


## Accept the Emails Coming Back from Spreadly


Spreadly adds the signature and sends the email back to Exchange Online, which delivers it. This connector lets Exchange Online accept these emails.


11. Go back to **Mail flow** > **Connectors** and click **Add a connector** again.
12. Under **Connection from**, select **Your organization's email server**. **Office 365** is already selected under **Connection to**. Click **Next**.
13. Enter `Spreadly (return)` in the **Name** field. Keep **Turn it on** checked and uncheck **Retain internal Exchange email headers**. Click **Next**.
14. Select **By verifying that the IP address of the sending server matches one of the following IP addresses**.
15. Copy each IP address from your Spreadly settings and click **+** after each one.
16. Click **Next**, then click **Create connector**.


## Add the Team Token and Route Outbound Mail


17. Go to **Mail flow** > **Rules**. Click **Add a rule** and select **Create a new rule**.
18. Enter `Send to Spreadly` in the **Name** field.
19. Under **Apply this rule if**, select **The sender** > **is external/internal** > **Inside the organization**.
20. Click **+** to add a second condition. Select **The sender** > **domain is** and add each of your verified domains.


| Spreadly only accepts emails of your verified domains. With this condition, emails of other domains are not sent to Spreadly and are delivered as usual.


21. Under **Do the following**, select **Redirect the message to** > **the following connector** and select **Spreadly**.
22. Click **+** to add a second action. Select **Modify the message properties** > **set a message header**.


|| Copy your team token from the Header value field in Spreadly. Spreadly shows the token only once, when it's created. If you no longer have it, create a new token. DO NOT SHARE THE TOKEN WITH OTHERS.


23. Enter `X-Spreadly-Tenant-Token` as the header name and paste your team token as the value.
24. Under **Except if**, select **The message headers** > **matches these text patterns**. Enter `X-Spreadly-Processed` as the header name and `.+` as the pattern.


| This makes sure that emails coming back from Spreadly are not sent to Spreadly again.


25. Click **Next**. Keep **Enforce** as the rule mode and check **Stop processing more rules**. Click **Next**, then click **Finish**.
26. New rules are turned off. Click the rule **Send to Spreadly** in the list and turn on **Enable or disable rule**.


## Result


Outgoing mail from your verified domains now routes through Spreadly, and the signature is added before the email reaches recipients. Mail that already carries the `X-Spreadly-Processed` header is skipped, so it won't be processed twice.

To test the setup, send an email to a recipient outside your organization.


## Troubleshooting


### The connector validation fails
Only the test email may fail. If the connection test fails, check that the smart host and the domain name are exactly `mx-sig.spreadly.app`, and that **Issued by a trusted certificate authority (CA)** is selected.


### Signatures don't appear on outgoing mail
Confirm that the rule **Send to Spreadly** is enabled and that the token in the header matches the one in your Spreadly settings. If you've created a new token, update the header value in the rule. Check that the domain of the sender is listed in the rule. In **Mail flow** > **Message trace**, you can see whether an email went through the connector **Spreadly**.


### Emails are not delivered
Check that the connector **Spreadly (return)** is turned on and lists all IP addresses from your Spreadly settings.


### Turn off server-side signatures
Turn off the rule **Send to Spreadly**. Exchange Online then sends emails without Spreadly again. You can keep the connectors.


## Related Articles
- [How to Add and Verify Domains](https://help.spreadly.app/en/article/setup-domains-gxztts/)
- [How to Set Up Server-Side Email Signatures for Google Workspace](https://help.spreadly.app/en/article/how-to-set-up-server-side-email-signatures-for-google-workspace-6tev1g/)
- [Microsoft Learn: Integrate Microsoft 365 with an email add-on service](https://learn.microsoft.com/en-us/exchange/mail-flow-best-practices/use-connectors-to-configure-mail-flow/integrate-office-365-with-an-email-add-on-service)