Email Suddenly Stopped Sending for M365 Email Provider

Overview

When using the M365 Email provider, emails suddenly stopped sending for all users.

Applies To

  • M365 Email provider

Cause

Azure client credentials might be expired and need to be renewed. If so, an error like the one below can be seen in this event when checking the tenant’s logs for “type:fn” events (failed notifications):

{
  "date": "timestamp here",
  "type": "fn",
  "description": "To: example@email.com",
  "connection": "Connection name here",
  "connection_id": "",
  "client_id": "client ID here",
  "details": {
    "email_type": "verify_email",
    "notification_type": "verify_email",
    "to": "example@email.com",
    "error": "Error sending email: invalid_client: 7000222 - [Timestamp
Z]: AADSTS7000222: The provided client secret keys for app 'Azure client ID here' are expired. Visit the Azure portal to create new keys for your app: https://aka.ms/NewClientSecret, or consider using certificate credentials for added security: https://aka.ms/certCreds..."
  },
  "user_id": "user ID here",
  "user_name": "username here",
  "log_id": "log id here",
  "tenant_name": "your name here",
  "_id": "id",
  "isMobile": false,
  "user_agent": "Other 0.0.0 / Other 0.0.0"
}

Solution

To resolve the issue, create a new set of client credential keys for the relevant Azure client the tenant’s email provider is pointed at, and then update the tenant’s email provider’s credentials to resume email sending.