Removing “mail.readwrite” Scope For the Outlook Mailer

Heads up! This article contains PHP code and is intended for developers. We offer this code as a courtesy but don’t provide support for code customizations or 3rd party development.

Overview

Would you like to remove the “mail.readwrite” scope for emails sent through the Outlook mailer? WP Mail SMTP requires this permission to allow users to attach large attachment files to emails sent from their site.

However, if you’d like to disable it, this tutorial will show you how to use a PHP snippet to remove the “mail.readwrite” scope for the Outlook mailer.

Note: Be sure to install and activate WP Mail SMTP on your site before adding the code snippet provided in this tutorial.

Setup

We recommend that you copy and paste the required snippet below into a new WPCode snippet. WPCode makes it easy and safe to run code snippets on your site.

For help with adding snippets to your site, please see our tutorial on adding code snippets using the WPCode plugin.

To proceed, copy and paste this snippet to your site. You’ll need to add this snippet to your site before configuring the Outlook mailer. This ensures the permission is revoked before authenticating WP Mail SMTP with your Microsoft account.

Note: Removing the “mail.readwrite” scope will prevent you from sending emails with large attachment files when using the Outlook mailer. The maximum file attachment size will be limited to 3MB.

That’s it! Now you know how to remove the “mail.readwrite” scope for the Outlook mailer.

Next, want to send notification emails from WP Mail SMTP to a BCC address? Be sure to see our guide to sending site notifications to a BCC address.

Try our Free WP Mail SMTP plugin

Use your favorite SMTP provider to reliably send your WordPress emails.

Please enable JavaScript in your browser to complete this form.