Title: Microsoft 365 plugin setup
Last modified: May 25, 2023

---

# Microsoft 365 plugin setup

 *  Resolved [AudunBK](https://wordpress.org/support/users/audunbk/)
 * (@audunbk)
 * [3 years ago](https://wordpress.org/support/topic/microsoft-365-plugin-setup/)
 * When I follow the instructions at [https://fluentsmtp.com/docs/setup-outlook-with-fluentsmtp/#obtain-microsoft-application-client-id–client-secret](https://fluentsmtp.com/docs/setup-outlook-with-fluentsmtp/#obtain-microsoft-application-client-id--client-secret)
   I need to be logged in at the Microsoft 365 account at two times (first to generate
   the «Application (Client) ID» og «Client Secret Value» and later to «Authenticate
   with Office 365 & Get Access Token»). Should I be logged in on the Microsoft 
   account that is the admin of the organization or with the Microsoft account that
   I want to send emails from?

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Support [Amimul Ihsan](https://wordpress.org/support/users/amimulihsanmahdi/)
 * (@amimulihsanmahdi)
 * [3 years ago](https://wordpress.org/support/topic/microsoft-365-plugin-setup/#post-16767637)
 * Hello [@audunbk](https://wordpress.org/support/users/audunbk/),
 * You need to log into the same account in the both time so if you logged into 
   different accounts, this will cause an issue with the API permission. In addition,
   you should log into the account that you want to send email from. So, if you 
   want to send email from [a@example.com](https://wordpress.org/support/topic/microsoft-365-plugin-setup/a@example.com?output_format=md)
   then you should log in and generate the API key from that account.
 * Thank you
 *  Thread Starter [AudunBK](https://wordpress.org/support/users/audunbk/)
 * (@audunbk)
 * [3 years ago](https://wordpress.org/support/topic/microsoft-365-plugin-setup/#post-16767666)
 * Thanks for the quick reply!
 *  Thread Starter [AudunBK](https://wordpress.org/support/users/audunbk/)
 * (@audunbk)
 * [3 years ago](https://wordpress.org/support/topic/microsoft-365-plugin-setup/#post-16771566)
 * Thank you for your kind support and for this great plugin, [@amimulihsanmahdi](https://wordpress.org/support/users/amimulihsanmahdi/)
 * I have a few follow-up questions after having followed the instructions above
   and generated the API key from the same email address that is set as “Sender 
   Email”. First I got an error message when I tried to log on the the Microsoft
   account after pressing «Authenticate with Office 365 & Get Access Token». The
   error message said “AADSTS700016: Application with identifier … was not found
   in the directory (domain name). This can happen if the application has not been
   installed by the administrator of the tenant or consented to by any user in the
   tenant. You may have sent your authentication request to the wrong tenant.”
 * In Settings –> “Connection Details” it says “Token Validity: Invalid. Please 
   re-authenticate”. In the email log it says { “code”: 423, “message”: “Unauthorized”,“
   errors”: [ “Unauthorized”] }.
 * Does this indicate that I have entered the wrong “Application Client Secret” 
   or “Application Client ID”? I read on [this page](https://learn.microsoft.com/en-us/answers/questions/692461/message-aadsts700016-application-with-identifier-n)
   that _“In case, after configuring the correct Client ID you still get this error,
   you need to construct the below URL and provide it to the Global administrator
   of your tenant, who will have to consent after successfully signing in.
   [https://login.microsoftonline.com/common/adminconsent?client\_id=your\_client\_id&#8221](https://login.microsoftonline.com/common/adminconsent?client_id=your_client_id&#8221);
 *  Plugin Support [Amimul Ihsan](https://wordpress.org/support/users/amimulihsanmahdi/)
 * (@amimulihsanmahdi)
 * [3 years ago](https://wordpress.org/support/topic/microsoft-365-plugin-setup/#post-16784998)
 * Hello [@audunbk](https://wordpress.org/support/users/audunbk/),
 * Apologies for the delay in getting back to you. From the error message, it seems
   like the account you have used to generate the credentials does not have permission
   to send emails. In that case, you can contact the administrator to provide permission
   or you can use another account that have the permission.
 * Let me know the update.
 * Thank you
 *  Thread Starter [AudunBK](https://wordpress.org/support/users/audunbk/)
 * (@audunbk)
 * [3 years ago](https://wordpress.org/support/topic/microsoft-365-plugin-setup/#post-16788400)
 * It worked well now after I generated a new “Application Client Secret” and added
   it again together with the “Application Client ID” and the new generated Access
   Token.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Microsoft 365 plugin setup’ is closed to new replies.

 * ![](https://ps.w.org/fluent-smtp/assets/icon.svg?rev=2458343)
 * [FluentSMTP - WP SMTP Plugin with Amazon SES, SendGrid, MailGun, Postmark, Google and Any SMTP Provider](https://wordpress.org/plugins/fluent-smtp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/fluent-smtp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/fluent-smtp/)
 * [Active Topics](https://wordpress.org/support/plugin/fluent-smtp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/fluent-smtp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/fluent-smtp/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [AudunBK](https://wordpress.org/support/users/audunbk/)
 * Last activity: [3 years ago](https://wordpress.org/support/topic/microsoft-365-plugin-setup/#post-16788400)
 * Status: resolved