Guides & TutorialsSystem Settings MailSetting Up Microsoft As Your Mail Service Provider

Setting Up Microsoft As Your Mail Service Provider

WHMCS comes with the ability to send emails without any additional configuration using PHP mail(). While this works in many cases, other mail providers may give you a better experience and access to additional features.

WHMCS 8.6 added support for Microsoft® services. Prior to this, in WHMCS 8.0 and later, this included Google® (with OAuth or SMTP authentication), Mailgun, SendGrid, SparkPost, and SMTP.

For more information, see:

To configure Microsoft, you will need to create an app in the Microsoft Azure® console and configure the mail provider in the Mail tab at Configuration > System Settings > General Settings. You must also set Friendly URLs in the General tab at Configuration > System Settings > General Settings to Full Friendly Rewrite or Friendly index.php.

Set Up Microsoft in WHMCS

To configure Microsoft on your WHMCS installation, go to Configuration > System Settings > General Settings and choose the Mail tab.

Next to Mail Provider, click Configure Mail Provider.

Select Microsoft as your Mail Provider.

Click the Copy icon next to Redirect URL.

Use this URL to create the necessary Microsoft Azure app. For instructions, see Create your Microsoft Azure Application below.

After you create your Microsoft Azure app, copy-and-paste the Application (client) ID and Client Secret from the Microsoft Azure console into the appropriate text boxes.

Click Connect. (Connection Token will be blank until you do this.)

If you have multiple Microsoft accounts, the system may prompt you to choose the correct account. If you see this prompt, log in to the email account from which WHMCS will send emails to clients.

After you complete the necessary prompts, a success message will display and WHMCS will automatically enter a token in Connection Token.

Click Save. The system will test your configuration again when you save.

Make certain to set your From Email address to the Microsoft mail account that you are using. Microsoft services may not accept email from a different identity.

Create Your Microsoft Azure Application

To use Microsoft as your service provider, you will need to create an app. This will let you connect to Microsoft via WHMCS. If you have already used the Microsoft Azure console, you may not need to perform some of these steps, or interfaces may not look like the screenshots below.

Go to the Microsoft Azure Portal and log in to your existing account or create a new one.

Go to Azure Active Directory.

Choose App registrations in the left-side menu and click New registration.

Enter a name for your application.

For Supported account types, select Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox).

For Redirect URI, select Web and use the Redirect URL value from WHMCS.

Save the application.

Copy and store the Application (client) ID value.

Application (client) ID

Click Add a certificate or secret next to Client credentials.

Enter a description and choose a validity length.

When the validity period expires, you must create a new client secret and repeat the steps to configure Microsoft in WHMCS.

Copy and store the Client Secret Value.

Client secret Value

You cannot retrieve the client secret again. You can use these values to complete configuration in WHMCS.