Getting started with TMS FNC Cloud Microsoft Outlook Mail
Prerequisites
- TMS FNC Core installed and the runtime package added to the project.
- TMS FNC Cloud Pack installed.
- An app registered in the Microsoft Entra admin center with a client ID, client secret, and a registered redirect URI, with Mail permissions granted.
Add the component
- Drop
TTMSFNCCloudMicrosoftOutlookMailonto a form (or create it in code). - Set the app credentials on
Authentication(client ID, secret, redirect URI). - Call
Connectto authenticate, then call mail operations fromOnConnected.
Minimal example
Set the credentials, connect, and list the mail folders once connected:
procedure TForm1.FormCreate(Sender: TObject);
begin
// Credentials from your app registration (https://portal.azure.com).
TMSFNCCloudMicrosoftOutlookMail1.Authentication.ClientID := 'your-client-id';
TMSFNCCloudMicrosoftOutlookMail1.Authentication.Secret := 'your-client-secret';
// Must match a redirect URI registered on the app.
TMSFNCCloudMicrosoftOutlookMail1.Authentication.CallBackURL := 'http://127.0.0.1:8000';
TMSFNCCloudMicrosoftOutlookMail1.OnConnected := OutlookMailConnected;
// Opens the Microsoft consent page in the browser and exchanges the code for tokens.
TMSFNCCloudMicrosoftOutlookMail1.Connect;
end;
procedure TForm1.OutlookMailConnected(Sender: TObject);
begin
TMSFNCCloudMicrosoftOutlookMail1.GetFolders;
end;
Next steps
- Authentication — credentials, the OAuth flow, and persisting tokens
- Folders and messages — listing folders and retrieving messages
- Attachments and inline images — downloading attachments and embedding inline images
- Sending and deleting — composing, sending and deleting messages
- API reference — full class reference