How do I send an E-Mail with user xx@yy.com but define another Sender where the xx@yy.com user has rights to send as or on behalf of?
Hi,
Can you please try using the parameter AApplicationUserIdOrEmail for the SendMessage / SendMailMessage methods to define another Sender?
In that case I'am getting this error:
Result from request [SEND MESSAGE] is {"error":{"code":"MailboxNotEnabledForRESTAPI","message":"The mailbox is either inactive, soft-deleted, or is hosted on-premise."}}
The error message seems to indicate that your mailbox is not configured correctly or this specific scenario is not yet supported.
We'll have to investigate if support for this scenario can be added and/or improved in a future version.
there is no mailbox, it is a Office 365 Outlook distribution group with its own email address that is publicly available
I think you need to fineadjust your component for Application Tokens. Some Endpoints are hard-coded and static defined like TestToken with use of
procedure InitializeTestTokensRequest(const ACloudBase: TTMSFNCCloudOAuth);
begin
  ACloudBase.Request.Clear;
  ACloudBase.Request.Name := 'TEST TOKENS';
  ACloudBase.Request.Host := 'https://graph.microsoft.com';
  ACloudBase.Request.Path := '/v1.0/me';
  ACloudBase.Request.AddHeader('Authorization', 'Bearer ' + ACloudBase.Authentication.AccessToken);
  ACloudBase.Request.Method := rmGET;
end;
but the docs say, the application tokens need to use URL:
https://login.microsoftonline.com/{tenant-id}/oauth2/v2.0/token
Can expect an "optimized" version shortly?
Thank you for your suggestion. We'll have to investigate if this option can be added in a future version of TMS FNC Cloud Pack.
Emailsharedmailbox.zip (8.4 KB)
Hi, I have a similar problem but managed to use MS Graph directly and bypass CloudPack.
But when it is implemented in CloudPack I will switch to that instead.
Regards
Roland