=== SMTP Manager by ByteCore Stack ===
Contributors: bytecorestack
Tags: smtp, email, mail, phpmailer, deliverability
Requires at least: 5.0
Tested up to: 7.0
Requires PHP: 7.2
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Send WordPress emails via SMTP. Logs deliveries, monitors SMTP health via WP-Cron, and alerts on Slack or Microsoft Teams when sending fails.

== Description ==

SMTP Manager by ByteCore Stack replaces the default WordPress mail function with a fully configurable SMTP connection. Every outgoing email is logged with its delivery status, and an optional health-check cron job monitors your SMTP server and alerts your team on Slack or Microsoft Teams the moment delivery starts failing.

**Features**

* Custom SMTP host, port, and encryption (SSL / TLS / none)
* Compatible with Gmail App Passwords, Outlook / Office 365, and any standard SMTP provider
* Custom From name and From email address
* Full email log — date, subject, sender, recipient, status, and error message
* Searchable and filterable log with date-range presets (today through all time)
* CSV export of the email log
* Automated SMTP health monitoring via WordPress Cron (TCP-only, no email sent)
* Slack and Microsoft Teams webhook alerts on consecutive SMTP failures
* Configurable failure threshold and maximum notification count
* One-click "Send Test Email" to verify your SMTP configuration instantly
* Scheduled HTML email delivery reports (daily / weekly / monthly)
* Automatic log pruning — keep the last 30 days or the last 1,000 records
* Dark-mode admin UI

== Installation ==

1. Upload the `bcs-smtp-manager` folder to `/wp-content/plugins/`.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Go to **Settings → SMTP Manager** and enter your SMTP credentials.
4. Click **Save Settings**, then use **Send Test Email** to verify delivery.

== Frequently Asked Questions ==

= Does this work with Gmail? =
Yes. You must use a Gmail App Password — Google no longer allows regular account passwords for third-party SMTP clients. Enable 2-Step Verification on your Google account, then generate an App Password under Security → App Passwords.

= Does this work with Outlook / Office 365? =
Yes. Use your Microsoft 365 account password or an app password. Set the host to `smtp.office365.com`, port `587`, encryption `TLS`.

= Does this work with WooCommerce? =
Yes. WooCommerce and any other plugin that sends email through `wp_mail()` will automatically use the SMTP settings configured here.

= Does this work with contact form plugins? =
Yes. Any plugin that uses the standard WordPress `wp_mail()` function — including Contact Form 7, WPForms, Gravity Forms, and others — will route email through your SMTP settings.

= Can I use this for bulk email marketing? =
No. This plugin is designed for transactional email (order confirmations, password resets, contact form notifications). For bulk marketing, use a dedicated service such as Mailchimp, Klaviyo, or Brevo.

= How does SMTP health monitoring work? =
When monitoring is enabled, WordPress Cron opens a TCP connection to your SMTP server on the configured port at a set interval. No email is sent. If the connection fails consecutively beyond your threshold, an alert is dispatched to your configured Slack or Teams webhook.

= How do I set up Slack alerts? =
In the Alerts tab, enable the Alert Channel toggle, select Slack, enter your Incoming Webhook URL, and save. Create the webhook at api.slack.com/messaging/webhooks.

= How do I set up Microsoft Teams alerts? =
In the Alerts tab, enable the Alert Channel toggle, select Microsoft Teams, paste your Incoming Webhook URL (created via the Teams channel Connectors dialog), and save.

= How does log pruning work? =
Log entries are pruned automatically once per day via WordPress Cron. You can choose to keep either the last 30 days of records or the last 1,000 records — whichever you select, older entries are removed automatically.

= Where are my SMTP credentials stored? =
Credentials are stored in the WordPress options table (`wp_options`) using the standard `update_option()` API. They are never transmitted to ByteCore Stack servers.

= What external services does this plugin use? =
See the "External Services" section below.

== External Services ==

This plugin may contact the following external services. All connections are either user-initiated or require explicit configuration by the site administrator.

**1. Your SMTP server (user-configured)**
The plugin routes all WordPress emails through the SMTP server credentials you enter in Settings → SMTP Manager. The hostname, port, username, and password are provided entirely by you. No data is sent to any ByteCore Stack server.

**2. Slack Incoming Webhooks (optional)**
If you enable Slack alerts, the plugin will POST a JSON failure notification to the Slack Incoming Webhook URL you provide when consecutive SMTP failures are detected. This URL is specific to your Slack workspace and is created by you.
* Service: Slack Technologies, LLC
* Privacy policy: https://slack.com/privacy-policy
* Terms of service: https://slack.com/terms-of-service

**3. Microsoft Teams Incoming Webhooks (optional)**
If you enable Teams alerts, the plugin will POST a JSON failure notification to the Teams Incoming Webhook URL you provide when consecutive SMTP failures are detected. This URL is specific to your Teams channel and is created by you.
* Service: Microsoft Corporation
* Privacy policy: https://privacy.microsoft.com/en-us/privacystatement
* Terms of service: https://www.microsoft.com/en-us/servicesagreement

**4. Google Fonts API**
The admin settings page loads two typefaces (DM Sans and DM Mono) from the Google Fonts API to render the admin UI. This request is made only by the administrator's browser when visiting the plugin settings page. No personal data from site visitors is ever transmitted.
* Service: Google LLC
* Privacy policy: https://policies.google.com/privacy
* Terms of service: https://policies.google.com/terms
* Font API endpoint: https://fonts.googleapis.com/

No data is collected, transmitted to, or processed by ByteCore Stack servers.

== Screenshots ==

1. SMTP settings panel with connection test result
2. Email log with search, date filters, status filters, and CSV export
3. Health monitoring and Slack / Teams webhook alert configuration
4. Scheduled email delivery report settings

== Changelog ==

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
