Forum > Third party

Send mail with Microsoft Graph API (using Daraja HTTP Framework)


Send mails via the Graph API: a new example project for the Daraja HTTP Framework demonstrates how to get an access token using the implicit grant flow, and how to invoke the Graph API to send an email. No additional configuration is required, as the project uses an existing Microsoft Entra App registratio´╗┐n, which is limited to the permissions for reading the user profile and sending emails.

You may configure your own App registration and use its Application (client) ID in the source code of unit MainUnit, or contact me to provide a modified App registration.

- Daraja HTTP Framework source and source/optional units.
- Indy 10.6.2 (
- OpenSSL DLLs for Indy (
- Delphi 2009+ or Lazarus / FPC 3.2

Example source code:

Daraja HTTP Framework download:

Feature overview:

Getting Started PDF:

Update / new blog post:

Microsoft identity platform and OAuth 2.0 authorization code flow example for Daraja HTTP Framework

The Authorization Code Flow with Proof Key for Code Exchange (PKCE) is a recommended OAuth 2.0 flow for native apps. No client secret is required in this flow. Instead, a secret is created by the calling application that can be verified by the authorization server.

The example application requests an authorization code, redeems the code for an access token, and then calls the Microsoft Graph API to retrieve user profile data, and to send an email on behalf of the signed-in user.

Software requirements
* Daraja HTTP Framework ( The example code is located in the entra_auth_code_flow folder of the master branch.
* Indy ( with OpenSSL DLLs for Indy (
* JsonDataObjects (

Daraja HTTP Framework download:


[0] Message Index

Go to full version