=== Mail Office 365 for WordPress ===
Contributors: adnets
Donate link: https://adnets.fr
Tags: email, smtp, office 365, microsoft 365, graph api, woocommerce, shared mailbox, oauth2
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Send your WordPress and WooCommerce emails via Microsoft Graph API (Office 365). Supports shared mailboxes, no SMTP needed. A plugin by Adnets SAS.

== Description ==

**Mail Office 365 for WordPress** by [Adnets SAS](https://adnets.fr) replaces the default PHP mail function with Microsoft Graph API, ensuring reliable email delivery through your Office 365 account.

Unlike SMTP-based solutions, this plugin uses the modern **Microsoft Graph API** with **OAuth2 client credentials** flow - no user interaction required, no SMTP ports to open, no passwords stored in plain text.

= Key Features =

* **Microsoft Graph API** - Modern, secure, no SMTP configuration needed
* **Shared Mailboxes** - Send from shared mailboxes (e.g., contact@yourcompany.com)
* **WooCommerce Compatible** - Order confirmations, invoices, shipping notifications
* **Client Credentials OAuth2** - No user login required, fully automated
* **Email Logs** - Track every email sent with status and error details
* **Attachments** - Full support for file attachments (up to 3MB)
* **HTML & Plain Text** - Automatic content type detection
* **CC / BCC / Reply-To** - Full header support
* **Graceful Fallback** - Falls back to PHP mail if not configured
* **Test Email** - Built-in email testing from the admin panel
* **Zero Dependencies** - No external libraries required

= How It Works =

1. Create a free Azure AD app registration
2. Grant the `Mail.Send` application permission
3. Enter your Tenant ID, Client ID, and Client Secret in the plugin settings
4. All WordPress emails are now sent via Microsoft 365!

= Perfect For =

* Businesses using Microsoft 365 / Office 365
* WooCommerce stores needing reliable email delivery
* Organizations with shared mailboxes
* Anyone tired of WordPress emails going to spam

= Requirements =

* A Microsoft 365 / Office 365 subscription (Business, Enterprise, or Education)
* An Azure AD app registration (free to create)
* The `Mail.Send` application permission granted with admin consent

== Installation ==

1. Upload the `mail-office-365` folder to `/wp-content/plugins/`
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Go to **Mail Office 365** in the admin sidebar
4. Follow the built-in setup guide to create your Azure AD app
5. Enter your credentials and send a test email

== Frequently Asked Questions ==

= Is an Azure AD app registration free? =

Yes! Creating an app registration in Azure AD is completely free. You only need an existing Microsoft 365 subscription.

= Does it work with shared mailboxes? =

Yes! This is one of the key features. Enter your shared mailbox address (e.g., contact@yourcompany.com) as the "From Email" and it will send from that address.

= What happens if the configuration is wrong? =

The plugin gracefully falls back to the default WordPress PHP mail function. Your emails will still be sent, just not through Microsoft 365.

= Is it compatible with WooCommerce? =

Yes! All WooCommerce emails (order confirmations, shipping notifications, password resets, etc.) are automatically routed through Microsoft 365.

= Why use Graph API instead of SMTP? =

Microsoft Graph API is more reliable than SMTP, doesn't require opening firewall ports, works better with modern security policies (no basic auth), and supports features like shared mailboxes natively.

= Does it support attachments? =

Yes, attachments up to 3MB are supported. This covers most WordPress and WooCommerce email use cases (invoices, receipts, etc.).

== Screenshots ==

1. Settings page with connection status
2. Email logs with send history
3. Built-in setup guide for Azure AD
4. Test email functionality

== Changelog ==

= 1.0.0 =
* Initial release
* Microsoft Graph API integration with client credentials OAuth2
* Shared mailbox support
* Email logging with admin interface
* WooCommerce compatibility
* Built-in test email and setup guide

== Upgrade Notice ==

= 1.0.0 =
Initial release. Configure your Azure AD credentials to start sending emails via Microsoft 365.

== About ==

Mail Office 365 for WordPress is developed and maintained by **Adnets SAS**, a French IT consulting company based in Libourne, France.

* **Website:** [adnets.fr](https://adnets.fr)
* **Support:** [adnets.fr/contact](https://adnets.fr/fr/contacts-essentiels-adnets-services-it/)
* **SIRET:** 939 821 971 00016
* **RCS:** Libourne
