Before you start: App registrations are restricted in the Dartmouth tenant. Submit a request to have one created with you as owner. See What to include in your request.
Quick Summary
- Microsoft Graph (
sendMail): the right choice for new applications. Saves to Sent Items, supports attachments, HTML and shared mailboxes.
- SMTP AUTH with OAuth2 (
AUTH XOAUTH2) to smtp.office365.com (port 587, STARTTLS): use only when your application or appliance cannot use Graph.
- Delegated: for applications where a user signs in interactively.
- Graph:
Mail.Send (and Mail.Send.Shared for shared mailboxes)
- SMTP:
https://outlook.office.com/SMTP.Send
- App-only: for unattended backend services with no interactive user.
- Graph: scoped via RBAC for Applications in Exchange Online. No Microsoft Graph API permission is added to the app registration and no tenant admin consent is required.
- SMTP: application permission
SMTP.SendAsApp with admin consent, plus an Exchange service principal scoped to the mailbox(es).
- Mailbox: a shared mailbox is preferred. Request one via the Help Desk process.
- Transactional mail only. Announcements, newsletters and list sends belong in an approved bulk channel. See Transactional vs. bulk email.
SMTP Basic Auth was retired at Dartmouth in September 2025. All sending must use OAuth2 (SMTP XOAUTH2 or Graph).
Choosing a flow
Two independent decisions: which API, and which authentication model.
| Your situation |
Use |
| New code, unattended backend service, no interactive user |
Graph app-only with RBAC scoping |
| New code, a user signs in and mail is sent on their behalf |
Graph delegated |
| An appliance, vendor product or library that can only use SMTP |
SMTP, app-only or delegated as the product supports |
| Announcements, newsletters, or any send to a list of recipients |
Neither. See Transactional vs. bulk email |
Delegated and app-only are suited to different designs rather than ranked against each other. A delegated token belongs to a signed-in user and is kept alive by a refresh token, which requires the application to run periodically and the user account to remain valid. App-only has no such dependency, and under RBAC the application's access is restricted to specific mailboxes.
Who Does What?
| App/Dev Team |
Infrastructure Team |
- Request the sender mailbox via the Help Desk process; confirm the From address.
- Choose integration path: Graph (
sendMail) or SMTP (XOAUTH2).
- Submit a request for the app registration.
- Delegated: implement Authorization Code + PKCE or Device Code, request the delegated scope, and obtain tokens with MSAL.
- App-only: use MSAL client credentials for a token.
- Generate and rotate the application's credential.
|
- Create the Entra app registration and set the requestor as owner.
- Graph app-only: register the app's service principal in Exchange Online and assign the appropriate application role, scoped to the sender mailbox.
- SMTP app-only: register the app's service principal in Exchange and grant SendAs on the mailbox.
- SMTP: enable Authenticated SMTP on the sender mailbox (per-mailbox control; leave disabled for Graph).
- Verify the scope, including a negative test against an unrelated mailbox, and record the result on the ticket.
- Grant tenant admin consent where application permissions are used (not required for Graph under RBAC).
|
Mailbox requirements
- A shared mailbox is preferred for service senders. A user mailbox works but consumes a licence and has a sign-in-capable account behind it.
- Sign-in should be blocked on the account behind a service mailbox.
- Authenticated SMTP is required only for the SMTP path. For Graph it should remain disabled.
- Scoping applies at the mailbox level. There is no way to scope an application to one calendar or folder within a mailbox and not another. If two applications need different levels of access, they need different mailboxes.
What to include in your request
- Application name
- Business owner and a secondary owner, ideally a team-owned group or shared account rather than a second individual, so the application is not orphaned when someone leaves Dartmouth.
- Sender mailbox address
- What the application needs to do: send only, or also read mail or manage calendar
- Expected volume, and whether any send goes to more than one recipient
- Hosting location
Flows
Graph, app-only (recommended for backend services)
Permissions are granted in Exchange Online through RBAC for Applications, not consented in Entra. The application registration holds no Microsoft Graph API permissions at all, so there is never a point at which it can act against any mailbox other than the one it is scoped to.
- Infrastructure creates the app registration: single tenant, no redirect URIs, public client flows disabled, and no API permissions. The default
User.Read delegated permission is removed.
- Infrastructure registers the app's service principal in Exchange Online and assigns the appropriate application role (for sending,
Application Mail.Send) scoped to the sender mailbox.
- Your application requests a token for
https://graph.microsoft.com/.default.
- Send using
POST https://graph.microsoft.com/v1.0/users/{mailbox}/sendMail.
Graph, delegated
- Scope:
Mail.Send, plus Mail.Send.Shared if sending as a shared mailbox.
- Acquire a delegated token via Authorization Code + PKCE or Device Code.
- Send using
POST https://graph.microsoft.com/v1.0/me/sendMail. For shared mailboxes, SendAs must be granted and the call is POST /users/{sharedMailbox}/sendMail.
- Messages are saved to Sent Items automatically.
SMTP, app-only
- App registration: application permission
Office 365 Exchange Online/SMTP.SendAsApp, with admin consent.
- Infrastructure registers a service principal in Exchange, scopes it to the mailbox(es) and grants SendAs.
- Infrastructure enables Authenticated SMTP on the sender mailbox.
- Request tokens for
https://outlook.office365.com/.default and use AUTH XOAUTH2 with the mailbox UPN.
SMTP, delegated
- Scope:
https://outlook.office.com/SMTP.Send, plus offline_access for refresh tokens.
- Acquire a delegated token via Authorization Code + PKCE or Device Code, then connect to
smtp.office365.com:587 with STARTTLS and issue AUTH XOAUTH2.
- The
user= value in the XOAUTH2 string must match the sending mailbox UPN exactly. For shared mailboxes, use the shared mailbox address.
Transactional vs. bulk email
Graph and SMTP are intended for transactional mail: messages triggered by a specific action, sent to the person who took it. Confirmations, receipts, password resets, appointment reminders, alerts.
They are not suitable for announcements, newsletters, or any message sent to a list of recipients. For those sending patterns, use an approved channel. Examples include:
Credentials
- As an owner of the app registration you can add and remove credentials yourself.
- Your team owns rotation.
- Entra sends expiration notifications to the application's owners. If an owner is a group, confirm that group receives mail.
Setup Checklists
Infrastructure Team
- Confirm the sender address is a mailbox.
- Create the app registration: single tenant, no redirect URIs, public client flows disabled, default
User.Read removed. For Graph app-only, add no API permissions.
- Set the requestor as an owner and add a secondary owner.
- Graph app-only: register the Exchange Online service principal (using the Object ID from Enterprise applications, not App registrations), create the resource scope, and assign the application role.
- SMTP app-only: register the Exchange service principal, grant SendAs, and enable Authenticated SMTP on the mailbox.
- Record the application ID and scope on the ticket.
App/Dev Team
- Confirm the sender mailbox exists and the From address is correct.
- Decide Graph vs SMTP, and delegated vs app-only.
- Store Tenant ID, Client ID and any secret or certificate securely. Secrets are not required for Device Code or PKCE.
- Delegated: use MSAL (Authorization Code + PKCE or Device Code) and implement token refresh.
- App-only: use MSAL client credentials for a token.
- Graph: call
/me/sendMail (delegated) or /users/{mailbox}/sendMail (app-only or shared).
- SMTP: connect to
smtp.office365.com:587 with STARTTLS and issue AUTH XOAUTH2.
Configuration Reference
SMTP Settings
- Server:
smtp.office365.com
- Port:
587
- TLS:
STARTTLS (required)
- Auth:
AUTH XOAUTH2 (OAuth2 access token)
- Sender: service/shared mailbox UPN (e.g.
app-sender@dartmouth.edu)
Graph Endpoints
- Delegated:
POST https://graph.microsoft.com/v1.0/me/sendMail
- App-only or shared:
POST https://graph.microsoft.com/v1.0/users/{mailbox}/sendMail
Token Requests
- Graph app-only: scope
https://graph.microsoft.com/.default. Under RBAC, no Graph application permission is consented on the registration.
- Graph delegated: scope
Mail.Send, plus Mail.Send.Shared for shared mailboxes.
- SMTP app-only: scope
https://outlook.office365.com/.default with permission SMTP.SendAsApp.
- SMTP delegated: scope
https://outlook.office.com/SMTP.Send, plus offline_access if refresh tokens are needed.
FAQ
I got “You don’t have permission to register applications in the Dartmouth College directory.”
Expected. App registration is restricted in our tenant. Submit a request with the details under What to include in your request and Infrastructure will create the registration with you as owner.
Why prefer Graph over SMTP?
Graph saves to Sent Items automatically, supports attachments, HTML and shared mailboxes, returns structured errors, and can be scoped with RBAC. SMTP AUTH is legacy, does not save copies to Sent Items, and requires an additional per-mailbox setting. Use SMTP only when your application cannot use Graph.
Does my mailbox need Authenticated SMTP enabled for Graph?
No. That setting governs SMTP client submission on port 587 only. Graph does not use it, and it should stay disabled on a service mailbox unless something specifically requires SMTP.
Why don’t SMTP-sent messages show in Sent Items?
SMTP does not save copies. Use Graph if Sent Items are required, or save a copy via Graph after sending.
Need Help?
Questions about which flow to use, or to request an app registration and mailbox scoping, email help@dartmouth.edu.