Skip to content
Nearlysent
Docs menu

Connect Outlook / Microsoft 365

Connect an Outlook or Microsoft 365 mailbox with Sign in with Microsoft - the steps, the permissions and why, reconnecting, admin consent for IT admins, and how to disconnect.

Nearlysent connects Microsoft mailboxes with Sign in with Microsoft. You sign in on Microsoft’s own page and approve access; Nearlysent never sees or stores your Microsoft password. This works for:

  • Personal Microsoft accounts: Outlook.com, Hotmail and Live addresses.
  • Work or school accounts on Microsoft 365 (Exchange Online). Your organization may first have to approve the app: see Admin consent.

Why not a password? Microsoft turned off password and app-password sign-in (basic authentication) for other mail apps: for personal accounts on 16 September 2024, see Microsoft: Modern Authentication Methods now needed to continue syncing Outlook Email in non-Microsoft email apps, and for Microsoft 365, see Microsoft: basic authentication in Exchange Online. Personal Outlook.com, Hotmail and Live addresses cannot connect with a password at all.

Connect your mailbox

You need the Admin or Owner role in the workspace.

  1. In your workspace go to Settings, tab General, card Mailboxes.
  2. In the box Microsoft 365 / Outlook, click Sign in with Microsoft. The button shows “Opening Microsoft…” while you are sent to Microsoft.
  3. Sign in with the Microsoft account of the mailbox you want to connect.
  4. Microsoft shows which permissions Nearlysent asks for (see below). Click Accept.
  5. You come back to Settings with the message “Mailbox connected with Microsoft. The first sync starts in a moment.” The mailbox is in the list with the provider Microsoft and the status Active.

The first sync imports the last 14 days of your inbox. After that, new mail is fetched every few minutes, or right away with Sync now.

Edit on a Microsoft mailbox only changes its Display name (the sender name, e.g. your company name): there are no server settings or password to change. Test connection there checks that the Microsoft sign-in still works.

Choosing Outlook / Office 365 under Add mailbox points you to Sign in with Microsoft as well. Only use that password form if your organization still allows IMAP/SMTP sign-in with a password for your work mailbox (most have it off).

Permissions and what they are for

Microsoft asks you to approve these permissions (Microsoft Graph, delegated: Nearlysent acts only as you, only in your own mailbox):

Permission Why
Mail.ReadWrite: read and write access to your mail Read new mail in your inbox, and put a reply in your Drafts folder when you click Save to my mailbox drafts.
Mail.Send: send mail as you Send a reply that a person in your team approved.
User.Read, openid, email: sign you in and read your profile Find out which email address the mailbox has.
offline_access: keep access to the data you gave it access to Keep syncing without asking you to sign in every hour.

What that means in practice:

  • Nothing is marked as read. Your mails stay unread in Outlook; Nearlysent only reads them.
  • Nothing is changed or deleted in your mailbox, except the draft copies Nearlysent saved itself (a newer copy replaces the old one, and it is removed once the reply is sent).
  • A person approves every email. Nearlysent writes drafts; it never sends anything until someone in your workspace clicks Send now. Sent replies are in the same conversation and in your Sent Items folder, like a reply you wrote in Outlook.
  • The sign-in tokens Microsoft gives Nearlysent are stored encrypted (AES-256-GCM) and are never written to logs.

Reconnect when the sign-in stops working

The sign-in can stop working when you remove the app’s access in your Microsoft account, change your password, or your organization revokes it. The next sync then stops: the mailbox shows the status Error with “The Microsoft sign-in has expired or was revoked. Reconnect with Microsoft to fix it.” and the Inbox says that syncing stopped for your address.

  1. Go to Settings → Mailboxes.
  2. Click Reconnect with Microsoft next to the mailbox.
  3. Sign in with the same Microsoft account and accept again.

The mailbox is Active again and syncing continues where it stopped; nothing is imported twice. If you sign in with another account, you see “You signed in with a different Microsoft account. Reconnect with the account of this mailbox.” To use another address, use Sign in with Microsoft to add it as a new mailbox.

Common errors

Message What to do
Sign-in with Microsoft was cancelled. No mailbox was connected. You closed or declined the Microsoft page. Click Sign in with Microsoft again and click Accept.
Your IT admin must approve this app before you can connect this mailbox. Your organization does not let users approve apps themselves. Send your IT admin to Admin consent.
This Microsoft account has no Outlook mailbox (Exchange Online). Sign in with an account that has one. The account has no mailbox in Microsoft 365 (for example a guest account or one without an Exchange Online license).
This kind of Microsoft account cannot be used with this app. Sign in with a personal Outlook.com account or a Microsoft 365 work or school account. Microsoft refused this account type for the app (for example error AADSTS50020, AADSTS50194 or AADSTS9002331: an account from another organization or identity provider, or a personal account where only work or school accounts are allowed). Sign in with another account, or ask the operator of this instance which account types it supports.
This address is already connected to this workspace with a password. Remove that mailbox first to connect it with Microsoft. Remove the old mailbox in the list, then Sign in with Microsoft.
The sign-in link expired or was already used. Start Sign in with Microsoft again. The sign-in took longer than 10 minutes, or the page was reloaded. Start again.
Connecting with Microsoft failed. Please try again. Something went wrong on the way. Try again in a moment.

For IT admins of a Microsoft 365 organization.

Many organizations do not allow users to approve apps that read mail. A user who tries to connect then sees a Microsoft page “Need admin approval” (error AADSTS65001: the user or administrator has not consented to use the application), and Nearlysent shows “Your IT admin must approve this app before you can connect this mailbox.”

An admin can grant consent once for the whole organization. You need one of the roles Global Administrator, Privileged Role Administrator, Cloud Application Administrator or Application Administrator. Choose one of these ways:

  • Sign in yourself: in Nearlysent, click Sign in with Microsoft with your admin account. On Microsoft’s permission page, tick Consent on behalf of your organization and click Accept. You may remove the mailbox that this connects afterwards; the consent stays.
  • Entra admin center: open entra.microsoft.com → Identity → Applications → Enterprise applications, open Nearlysent (it appears after the first sign-in attempt from your organization), then Security → Permissions → Grant admin consent for your organization. If your tenant uses the admin consent workflow, the user’s request is also under Enterprise applications → Admin consent requests.
  • Admin-consent URL: open this address signed in as an admin, with your tenant ID (or domain) and the app’s Application (client) ID, which we give you on request through the contact form:
https://login.microsoftonline.com/<your-tenant-id>/adminconsent?client_id=<application-client-id>

The app asks only for these delegated Microsoft Graph permissions: offline_access, openid, email, User.Read, Mail.ReadWrite and Mail.Send. Delegated means Nearlysent only ever acts as the user who signed in, in that user’s own mailbox; it has no application permissions and cannot read other mailboxes in your organization. After consent, users connect their mailbox with Sign in with Microsoft as above.

To allow the app for some users only, set Assignment required? to Yes under Properties of the enterprise application and assign those users or groups.

Disconnect

  • Remove the mailbox in Nearlysent: Settings → Mailboxes → Remove next to the mailbox. This deletes the Microsoft sign-in tokens and the imported threads in Nearlysent. Nothing changes in your mailbox itself.
  • Also remove the app’s access at Microsoft:
    • personal account (Outlook.com, Hotmail, Live): open account.live.com/consent/Manage (Microsoft account → Privacy → Apps and services), choose Nearlysent and click Remove these permissions;
    • work or school account: open myapps.microsoft.com, open the menu of Nearlysent and choose Manage your application → Revoke permissions (if your organization granted admin consent, your IT admin removes it in the Entra admin center under Enterprise applications).

Removing the access at Microsoft without removing the mailbox stops the sync: the mailbox then shows Reconnect with Microsoft.

Something unclear or missing in the docs?Tell us.