Go to Entra portal → App registrations → New registration
Select Create Your Own Application
Name the app (e.g., FastClose Email Sender)
Click Create

Choose Supported account types: Single tenant
Redirect URI: Not required
Click Register

Under Enterprise Applications
Select the newly created Application and Click Single Sign On
Click Go To Application
Select the Overview tab

Copy:
Directory (tenant) ID
Application (client) ID
Click Endpoints and Copy the OpenID Connect metadata document (aka The OIDC well-known endpoint)
These will be used by your service to request OAuth tokens.
In your app → Certificates & secrets
Click New client secret
Set an expiration period (recommended 1 year)
Copy the VALUE immediately — you cannot retrieve it later
You now have:
Tenant ID
Application Client ID
Client Secret
OIDC well-known endpoint
You need Mail.Send (Application) — NOT delegated.
App → API permissions

Add a permission → Microsoft Graph → Application permissions
Add Mail.Send

Click Grant admin consent