We have successfully migrated our SAS email functionality from SMTP with Basic Authentication to an OAuth2-based approach using Microsoft Azure Portal and Microsoft Graph API.
Currently, we are able to trigger emails successfully using OAuth2. However, we are facing an issue while sending Excel file attachments.
As part of the OAuth2-based email implementation, we are converting the Excel (.xlsx) file into Base64 format and attaching it using the content Bytes attribute in the Graph API request. Although the email is delivered successfully with the attachment, the Excel file fails to open when downloaded from the email and shows an error indicating that the file is corrupted or the format is invalid.
We have attached the following for your reference: