=== NoorSMTP – SMTP & Gmail API for Email Delivery ===
Contributors: noorwork
Tags: smtp, email, gmail api, mailer, email log
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Reliably send WordPress emails via SMTP or the Gmail API, with email delivery logging and an instant test-email tool.

== Description ==

Tired of WordPress emails getting lost, marked as spam, or failing to deliver? **NoorSMTP** improves WordPress email deliverability by routing outgoing emails through a reliable SMTP server or the Gmail API using secure OAuth 2.0 authentication, replacing the default PHP `mail()` function.

Whether you run a WooCommerce store, blog, membership site, or business website, NoorSMTP helps ensure that password resets, contact form submissions, order receipts, and admin notifications reach the recipient's inbox.

### 🚀 Key Features

* **Custom / Standard SMTP Provider:** Connect to any SMTP host (including Sendgrid, Mailgun, Amazon SES, Brevo, Postmark, Yahoo, Zoho, or your web hosting email server) with custom port, authentication, and SSL/TLS encryption.
* **Gmail API with Secure OAuth 2.0:** Send emails directly through Google's official Gmail API without storing your Google account password or creating less secure app passwords.
* **Email Delivery Logging:** Automatically track outgoing emails with delivery status (Sent / Failed), recipient, subject, mailer used, date, timestamp, and technical error diagnostics.
* **Instant Delivery Test Tool:** Send test emails to any recipient address and view real-time server responses and debug logs to verify setup in seconds.
* **Safe Data Management:** Your email logs and settings are preserved safely on plugin deactivation or uninstall by default. A dedicated setting with user confirmation allows full data removal only when explicitly chosen.
* **Modern & Clean Interface:** Built specifically for WordPress administrators with an intuitive, accessible dashboard.

### 🌟 Need Advanced Features? Explore NoorSMTP Pro

NoorSMTP Free is completely independent, functional, and self-contained with no time limits or artificial restrictions. For high-volume sites needing advanced deliverability tools, our separate premium extension, **NoorSMTP Pro**, offers:

* **Additional Direct API Integrations:** Native API dispatch for Amazon SES, Mailgun, SendGrid, Postmark, Brevo, and Resend.
* **Automatic Multi-Server Failover:** If your primary SMTP server hits rate limits or experiences downtime, emails are automatically routed through configured backup servers.
* **Smart Source & Domain Routing:** Dispatch emails through specific servers based on the sending plugin (WooCommerce, WPForms, Contact Form 7, Gravity Forms) or recipient domain.
* **Full Email Body Storage & Resend:** Store complete email bodies and resend failed emails with one click.
* **Open & Click Tracking:** Engagement analytics to monitor whether recipients opened your emails and clicked links.
* **Instant Failure Notifications:** Receive immediate email or webhook alerts when a critical delivery fails.

Learn more about [NoorSMTP Pro](https://noorwork.com/noorsmtp).

== External Services ==

This plugin can optionally connect to Google APIs when you configure and enable the **Gmail API** mailer.

* **Service:** Google OAuth 2.0 & Gmail REST API
* **Provider:** Google LLC
* **When is it used?** When you choose "Gmail API" as your active mailer and authorize your Google account, or when WordPress dispatches an email using the Gmail mailer.
* **What data is sent?**
  - During OAuth authorization: Client ID, Client Secret, authorization grant code, and redirect URI are sent to `https://oauth2.googleapis.com/token` to obtain and refresh API access tokens.
  - During email dispatch: Email recipient addresses, sender email address, subject line, email body content, and MIME attachments are transmitted to `https://gmail.googleapis.com/upload/gmail/v1/users/me/messages/send` via RFC 2822 base64url encoded payloads to deliver the email through your Google account.
* **Terms of Service:** [Google Terms of Service](https://policies.google.com/terms)
* **Privacy Policy:** [Google Privacy Policy](https://policies.google.com/privacy)
* **API User Data Policy:** [Google API Services User Data Policy](https://developers.google.com/terms/api-services-user-data-policy)

== Installation ==

1. Log in to your WordPress admin dashboard.
2. Navigate to **Plugins > Add New** and search for **NoorSMTP**.
3. Click **Install Now**, then click **Activate**.
4. Go to **NoorSMTP > Settings** in your WordPress admin menu.
5. Choose your preferred mailer (**Custom SMTP** or **Gmail API**).
6. Enter your mailer credentials and save your settings.
7. Go to **NoorSMTP > Test Email** to send a test message and verify deliverability.

== Frequently Asked Questions ==

= Does NoorSMTP require a paid subscription? =
No. NoorSMTP is free and fully functional. There are no artificial limits on the number of emails you can send through your configured SMTP server or Gmail API.

= Can I use Gmail or Google Workspace? =
Yes! You can connect your Gmail or Google Workspace account using the official Gmail API via OAuth 2.0. This provides enhanced security because you do not need to store account passwords or enable "Less secure apps".

= Does the plugin slow down my site? =
No. NoorSMTP is lightweight and executes only during outgoing email requests and admin screen visits. Email logging uses indexed database tables optimized for quick lookups.

= What happens if I uninstall the plugin? =
By default, NoorSMTP keeps your settings and email logs intact so you do not lose data if you temporarily deactivate or reinstall the plugin. If you wish to delete all data upon uninstall, you can enable the "Delete Data on Uninstall" option under Settings after confirming the prompt.

= What is the difference between NoorSMTP Free and NoorSMTP Pro? =
NoorSMTP Free includes everything needed to reliably send and log WordPress emails via Custom SMTP or the Gmail API. NoorSMTP Pro is an optional commercial add-on for high-volume and enterprise stores that adds automatic multi-server failover, smart routing by plugin/domain, full email body storage & resend capability, email open & click tracking, failure alert notifications, and dedicated direct APIs (Amazon SES, SendGrid, Mailgun, Postmark, Brevo, Resend).

== Screenshots ==

1. NoorSMTP Settings – Select and configure your preferred mailer (SMTP or Gmail API).
2. Email Delivery Log – View status, timestamp, recipients, and diagnostic errors.
3. Email Details Modal – Inspect delivery status, timestamp, recipient, mailer, and technical error diagnostics.
4. Test Email Tool – Send a test message with real-time connection diagnostics.

== Changelog ==

= 1.0.0 =
* Initial release.
