Hi,
After Microsoft announced to disable Basic Authentication this year in October for Exchange Online, I am looking for a solution to continue sending mails with Aspose.Email and an Exchange Online. I came across this blog article: https://blog.aspose.com/2022/04/18/create-and-send-messages-using-microsoft-graph-api-in-csharp/
But when I pretend exactly like this I get this error message (anonymized):
Server error Status: InvalidAuthenticationToken
Description: CompactToken parsing failed with error code: 80049217
Details:
“>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>”
POST: https://graph.microsoft.com/v1.0/me/sendMail
Authorization: Bearer XXXXX
Content-Length: 332
Content-Type: application/json
Accept: application/json
{“message”:{“body”:{“content”:“EMAILNET-39318 REST API v1.0 - Create Message”,“contentType”:“Text”},“sender”:{“emailAddress”:{“address”:“rightMailadress@tld.de”,“name”:“Testname”}},“subject”:“EMAILNET-39318 XXXXX”,“toRecipients”:[{“emailAddress”:{“address”:“test@test.de”,“name”:""}}]}}
StatusCode: Unauthorized
Transfer-Encoding: chunked
Strict-Transport-Security: max-age=31536000
request-id: XXXX
client-request-id: XXXX
x-ms-ags-diagnostic: {“ServerInfo”:{“DataCenter”:“Germany West Central”,“Slice”:“E”,“Ring”:“5”,“ScaleUnit”:“001”,“RoleInstance”:“XXXX”}}
WWW-Authenticate: Bearer realm="", authorization_uri=“https://login.microsoftonline.com/common/oauth2/authorize”, client_id=“00000003-0000-0000-c000-000000000000”
Date: Sun, 05 Jun 2022 13:47:29 GMT
Content-Type: application/json
{“error”:{“code”:“InvalidAuthenticationToken”,“message”:“CompactToken parsing failed with error code: 80049217”,“innerError”:{“date”:“2022-06-05T13:47:30”,“request-id”:“XXXXX”,“client-request-id”:“XXXXX”}}}
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<