Sending e-mails through Office 365

Sending e-mails through Office 365

I recently signed up for an Office 365 Business Essentials subscription to get the benefit of Exchange and other nice features without the hassle of managing it myself, as part of this I wanted to setup a no-reply e-mail address I could use to send automated e-mails without having to fork out extra for another user. The answer I found lies in using a shared mailbox for the e-mail address and preventing it from accepting incoming e-mails, then configuring the client to use Office 365 as an SMTP relay.

I have written this guide assuming that the Business Essentials subscription is being used. You may have slightly different options available to you if you are using a different subscription.

Office 365 as an SMTP relay

Using Office 365 as an SMTP relay doesn’t require a username and password (which avoids having to create an extra user) but it does rely on the client having a static IP address, so if your client doesn’t these steps won’t work for you.

Required Information

Before you set off down this road there are a few pieces of information that you’ll need to collect:-

  • The public IP address of the client.
  • Your SMTP host address – this happens to be your MX record.

You will also need to make sure that the domain you are planning on using is verified in Office 365.

Creating the Shared Mailbox

  1. Login to the Office 365 Portal and go to the Admin Dashboard.
  2. Under “users & groups” click on the “Add users, reset passwords, and more” link.
    Users and Groups Screenshot
  3. Click on the “Shared Mailboxes” heading.
    Shared Mailboxes
  4. Click on the “+” symbol to create a new shared mailbox.
  5. Enter a Mailbox name and an e-mail address (this will be the name and address e-mails are sent from).
    Add Shared Mailbox Screenshot
  6. On the next step you need to find a user who you want to be able to access the shared mailbox, even though there should be no mail I’d still recommend giving a user access to the mailbox just in case.
    Add Members Screenshot
  7. Click on the “Finish” button to create the shared mailbox.

Create a Connector

  1. Login to the Exchange Admin Center.
  2. Under “mail flow” click on the “connectors” link.
    Mail Flow Screenshot
  3. Click on the “+” symbol under “Inbound Connectors” to create a new connector.
    Inbound Connectors Screenshot
  4. In the window which appears enter a connector name and set the “Connector Type” option to “On-premises”.
    New Connector Screenshot
  5. Scroll a bit further down the window and under “Sender domains” add an entry for “*”. This allows e-mail to be received for sending from any domain. If you want to you can restrict this but I will assume the IP authentication will be sufficient for this guide.
    Sender Domains Screenshot
  6. If you now scroll to the bottom of the window and under “Sender IP addresses” add an entry for the public IP address of the client.
  7. Save the connector.

Preventing incoming e-mail

  1. While logged into the Exchange Admin Center click on the “recipients” link from the menu at the side of the screen.
    ECP Screenshot
  2. Click on the “shared” header at the top of the screen.
  3. Highlight the shared mailbox that was created at the beginning and then click on the “edit” pencil symbol.
  4. In the window which loads click on the “mailbox features” link.
    Mailbox Features Screenshot
  5. Scroll down to the bottom of the window and under “Message Delivery Restrictions” click on “View details”.
  6. In the window which opens set “Accept messages from” to “Only senders in the following list” and then add an entry for the shared mailbox.
    Restrict Senders Screenshot
    This will cause any e-mails from users inside your organisation to this mailbox to be rejected.
  7. Ensure that “Require that all senders are authenticated” is checked.
    This will cause any e-mails from users outside of your organisation to this mailbox to be rejected.
  8. Click on “ok”.
  9. Click on “save”.

After you’ve completed the steps you should have a working address you can use to send e-mails from your clients.

You should also add the IP address(es) of the client(s) to the SPF record for your domain to reduce the risk that e-mail spam filters will prevent any sent e-mails reaching its destination.

The short guide above is a culmination of the documentation found at the following URLs on the Microsoft website.