{"title":"Analyze email telemetry","url":"https://jonas-paprotka.de/docs/dev-itpro/administration/telemetry-email-trace/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/telemetry-email-trace, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/telemetry-email-trace","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Analyze email telemetry in Business Central to monitor email delivery and troubleshoot failures when connecting or authenticating to SMTP servers.","date":"2026-11-17","meta":{"topic":"reference"},"outline":[{"level":1,"title":"Analyze email telemetry","slug":"analyze-email-telemetry","at":0,"chars":11120},{"level":2,"title":"Email sent successfully","slug":"email-sent-successfully","at":977,"chars":1406},{"level":3,"title":"General dimensions","slug":"general-dimensions","at":1066,"chars":288},{"level":3,"title":"Custom dimensions","slug":"custom-dimensions","at":1354,"chars":1029},{"level":2,"title":"Failed to send email","slug":"failed-to-send-email","at":2383,"chars":1648},{"level":3,"title":"General dimensions","slug":"general-dimensions-1","at":2464,"chars":331},{"level":3,"title":"Custom dimensions","slug":"custom-dimensions-1","at":2795,"chars":1236},{"level":2,"title":"SMTP server authentication","slug":"smtp-server-authentication","at":4031,"chars":1920},{"level":3,"title":"General dimensions","slug":"general-dimensions-2","at":4126,"chars":307},{"level":3,"title":"Custom dimensions","slug":"custom-dimensions-2","at":4433,"chars":869},{"level":3,"title":"Sample KQL code","slug":"sample-kql-code","at":5302,"chars":649},{"level":2,"title":"SMTP server connections","slug":"smtp-server-connections","at":5951,"chars":1889},{"level":3,"title":"General dimensions","slug":"general-dimensions-3","at":6039,"chars":303},{"level":3,"title":"Custom dimensions","slug":"custom-dimensions-3","at":6342,"chars":861},{"level":3,"title":"Sample KQL code","slug":"sample-kql-code-1","at":7203,"chars":637},{"level":2,"title":"Email sent (using SMTP)","slug":"email-sent-using-smtp","at":7840,"chars":1848},{"level":3,"title":"General dimensions","slug":"general-dimensions-4","at":7916,"chars":289},{"level":3,"title":"Custom dimensions","slug":"custom-dimensions-4","at":8205,"chars":863},{"level":3,"title":"Sample KQL code","slug":"sample-kql-code-2","at":9068,"chars":620},{"level":2,"title":"Sample KQL code for alerting on SMTP failures","slug":"sample-kql-code-for-alerting-on-smtp-failures","at":9688,"chars":1251},{"level":2,"title":"Related information","slug":"related-information","at":10939,"chars":181}],"text":"# Analyze email telemetry\nAPPLIES TO: Business Central 2020 release wave 2, update 17.2, and later\nEmail telemetry gathers data about the following operations:\n An email was sent successfully\n An attempt to send an email failed\nIn application versions that include the SMTP telemetry events documented below, the following operations are also emitted to telemetry:\n Authentication to an SMTP server succeeded or failed\n Connection to an SMTP server succeeded or failed\n Sending an email through SMTP succeeded or failed\nBefore you can collect this data, you'll have to set up email. See Set Up Email</admin-how-setup-email> in the Business Central application help.\nThese events use `TelemetryScope::All`. The failed-to-send event uses error verbosity (severityLevel 3). The other events use normal verbosity (severityLevel 1), including SMTP events whose result dimension is No.\n> TIP\n> You can also view failed emails in the Email Outbox page in the Business Central client.\n## Email sent successfully\nOccurs when the email dispatcher successfully sends an email.\n### General dimensions\nDimension|Description or value\nmessage|Email sent\nuser_Id|The user telemetry ID for the user. From the user card, you can use user_Id to identify the user who triggered this telemetry event. See telemetry-enable-application-insights#assign-a-telemetry-id-to-users.\n### Custom dimensions\nDimension|Description or value\naadTenantId|Specifies the Microsoft Entra tenant ID used for Microsoft Entra authentication. For on-premises, if you aren't using Microsoft Entra authentication, this value is common.\nclientType|Specifies the type of client that opened the session, such as Background or Web. For a list of the client types, see ClientType Option Type<../developer/methods-auto/clienttype/clienttype-option>.\ncompanyName|The current company name.\nenvironmentName|Specifies the name of the tenant environment. See Managing Environments<tenant-admin-center-environments>.\nenvironmentType|Specifies the environment type for the tenant, such as Production or Sandbox. See tenant-admin-center-environments#types-of-environments.\nalFeatureName|Emailing\nalEventName|Email sent\nalObjectId|8713, which is the ID of the system application telemetry logger codeunit.\nalObjectName|`System Telemetry Logger`, which emits the event on behalf of the email dispatcher.\nalObjectType|CodeUnit\neventId|AL0000CTV\n## Failed to send email\nOccurs when the email dispatcher fails to send an email.\n### General dimensions\nDimension|Description or value\nmessage|The error text returned by the failed send operation.\nuser_Id|The user telemetry ID for the user. From the user card, you can use user_Id to identify the user who triggered this telemetry event. See telemetry-enable-application-insights#assign-a-telemetry-id-to-users.\n### Custom dimensions\nDimension|Description or value\naadTenantId|Specifies the Microsoft Entra tenant ID used for Microsoft Entra authentication. For on-premises, if you aren't using Microsoft Entra authentication, this value is common.\nclientType|Specifies the type of client that opened the session, such as Background or Web. For a list of the client types, see ClientType Option Type<../developer/methods-auto/clienttype/clienttype-option>.\ncompanyName|The current company name.\nenvironmentName|Specifies the name of the tenant environment. See Managing Environments<tenant-admin-center-environments>.\nenvironmentType|Specifies the environment type for the tenant, such as Production or Sandbox. See tenant-admin-center-environments#types-of-environments.\nalFeatureName|Emailing\nalEventName|Failed to send email\nalErrorCallStack|Specifies the AL callstack when the error occurred. This dimension was added in version 19.0.\nalErrorText|Specifies the AL error message. This dimension was added in version 19.0.\nalObjectId|8713, which is the ID of the system application telemetry logger codeunit.\nalObjectName|`System Telemetry Logger`, which emits the event on behalf of the email dispatcher.\nalObjectType|CodeUnit\neventId|AL0000CTP\n## SMTP server authentication\nOccurs when the SMTP module is authenticating to an SMTP server.\n### General dimensions\nDimension|Description or value\nmessage|Authenticated to SMTP server.\nuser_Id|The user telemetry ID for the user. From the user card, you can use user_Id to identify the user who triggered this telemetry event. See telemetry-enable-application-insights#assign-a-telemetry-id-to-users.\n### Custom dimensions\nDimension|Description or value\naadTenantId|Specifies the Microsoft Entra tenant ID used for Microsoft Entra authentication. For on-premises, if you aren't using Microsoft Entra authentication, this value is common.\nclientType|Specifies the type of client that opened the session, such as Background or Web. For a list of the client types, see ClientType Option Type<../developer/methods-auto/clienttype/clienttype-option>.\ncompanyName|The current company name.\nenvironmentName|Specifies the name of the tenant environment. See Managing Environments<tenant-admin-center-environments>.\nenvironmentType|Specifies the environment type for the tenant, such as Production or Sandbox. See tenant-admin-center-environments#types-of-environments.\neventId|AL0000GKK\nalAuthenticated|Specifies whether authentication succeeded. Possible values are Yes or No.\n### Sample KQL code\nThis KQL code can help you get started analyzing SMTP authentication failures:\n```kql\n// Authenticated to SMTP server\ntraces\n| where timestamp > ago(60d) // adjust as needed\n| where customDimensions.eventId == 'AL0000GKK'\n| where customDimensions.alAuthenticated == 'No'\n| project timestamp\n, aadTenantId = customDimensions.aadTenantId\n, environmentName = customDimensions.environmentName\n, environmentType = customDimensions.environmentType\n, companyName = customDimensions.companyName\n, clientType = customDimensions.clientType\n```\nTo learn more about how to set up alerting on Business Central telemetry, see telemetry-alert.\n## SMTP server connections\nOccurs when the SMTP module is connecting to an SMTP server.\n### General dimensions\nDimension|Description or value\nmessage|Connected to SMTP server.\nuser_Id|The user telemetry ID for the user. From the user card, you can use user_Id to identify the user who triggered this telemetry event. See telemetry-enable-application-insights#assign-a-telemetry-id-to-users.\n### Custom dimensions\nDimension|Description or value\naadTenantId|Specifies the Microsoft Entra tenant ID used for Microsoft Entra authentication. For on-premises, if you aren't using Microsoft Entra authentication, this value is common.\nclientType|Specifies the type of client that opened the session, such as Background or Web. For a list of the client types, see ClientType Option Type<../developer/methods-auto/clienttype/clienttype-option>.\ncompanyName|The current company name.\nenvironmentName|Specifies the name of the tenant environment. See Managing Environments<tenant-admin-center-environments>.\nenvironmentType|Specifies the environment type for the tenant, such as Production or Sandbox. See tenant-admin-center-environments#types-of-environments.\neventId|AL0000GKJ\nalConnected|Specifies whether connection succeeded. Possible values are Yes or No.\n### Sample KQL code\nThis KQL code can help you get started analyzing SMTP connection failures:\n```kql\n// Connected to SMTP server\ntraces\n| where timestamp > ago(60d) // adjust as needed\n| where customDimensions.eventId == 'AL0000GKJ'\n| where customDimensions.alConnected == 'No'\n| project timestamp\n, aadTenantId = customDimensions.aadTenantId\n, environmentName = customDimensions.environmentName\n, environmentType = customDimensions.environmentType\n, companyName = customDimensions.companyName\n, clientType = customDimensions.clientType\n```\nTo learn more about how to set up alerting on Business Central telemetry, see telemetry-alert.\n## Email sent (using SMTP)\nOccurs when the SMTP module is sending an email.\n### General dimensions\nDimension|Description or value\nmessage|Sent email.\nuser_Id|The user telemetry ID for the user. From the user card, you can use user_Id to identify the user who triggered this telemetry event. See telemetry-enable-application-insights#assign-a-telemetry-id-to-users.\n### Custom dimensions\nDimension|Description or value\naadTenantId|Specifies the Microsoft Entra tenant ID used for Microsoft Entra authentication. For on-premises, if you aren't using Microsoft Entra authentication, this value is common.\nclientType|Specifies the type of client that opened the session, such as Background or Web. For a list of the client types, see ClientType Option Type<../developer/methods-auto/clienttype/clienttype-option>.\ncompanyName|The current company name.\nenvironmentName|Specifies the name of the tenant environment. See Managing Environments<tenant-admin-center-environments>.\nenvironmentType|Specifies the environment type for the tenant, such as Production or Sandbox. See tenant-admin-center-environments#types-of-environments.\neventId|AL0000GKL\nalSent|Specifies whether sending the email succeeded. Possible values are Yes or No.\n### Sample KQL code\nThis KQL code can help you get started analyzing failures in sending emails:\n```kql\n// Sent email\ntraces\n| where timestamp > ago(60d) // adjust as needed\n| where customDimensions.eventId == 'AL0000GKL'\n| where customDimensions.alSent == 'No'\n| project timestamp\n, aadTenantId = customDimensions.aadTenantId\n, environmentName = customDimensions.environmentName\n, environmentType = customDimensions.environmentType\n, companyName = customDimensions.companyName\n, clientType = customDimensions.clientType\n```\nTo learn more about how to set up alerting on Business Central telemetry, see telemetry-alert.\n## Sample KQL code for alerting on SMTP failures\nUse this KQL code if you want to set up alerts on SMTP failures, either failures authenticating/connecting to SMTP servers or failures on sending emails.\n```kql\ntraces\n| where timestamp > ago(1d) // adjust as needed\n| where  customDimensions.eventId == 'AL0000CTP'\n     or (customDimensions.eventId == 'AL0000GKK' and customDimensions.alAuthenticated == 'No')\n     or (customDimensions.eventId == 'AL0000GKJ' and customDimensions.alConnected == 'No')\n     or (customDimensions.eventId == 'AL0000GKL' and customDimensions.alSent == 'No')\n| extend EventId = customDimensions.eventId\n| summarize count() by\n  aadTenantId = tostring( customDimensions.aadTenantId )\n, environmentName = tostring( customDimensions.environmentName )\n, environmentType = tostring( customDimensions.environmentType )\n, companyName = tostring( customDimensions.companyName )\n, clientType = tostring( customDimensions.clientType )\n, ErrorType = case (\n  EventId == 'AL0000CTP', 'Other'\n, EventId == 'AL0000GKK', 'SMTP authentication'\n, EventId == 'AL0000GKJ', 'SMTP connection'\n, EventId == 'AL0000GKL', 'SMTP email'\n, 'Unknown'\n)\n```\nTo learn more about how to set up alerting on Business Central telemetry, see telemetry-alert.\n## Related information\nMonitoring and Analyzing Telemetry<telemetry-overview>\nEnable Sending Telemetry to Application Insights<telemetry-enable-application-insights>\ntelemetry-alert"}