=== Kavin SMTP ===
Contributors: arpansahdev
Tags: smtp, email delivery, email, mailer, gmail
Requires at least: 5.6
Tested up to: 7.1
Requires PHP: 7.2
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Fix WordPress email. Send wp_mail through your SMTP server, and let the Connection Doctor find out why email isn't sending.

== Description ==

By default WordPress sends email with the PHP `mail()` function, which many hosts do not configure correctly — so password resets, order receipts and contact-form messages land in spam or never arrive at all.

**Kavin SMTP** reroutes all outgoing WordPress email through a proper SMTP server that authenticates your site, dramatically improving deliverability. Configure it once in a clean settings screen and send a test email to confirm it works.

And when email still fails, the **Connection Doctor** finds out why.

= Connection Doctor =

Most SMTP plugins show you an error code and leave you to search for it. Kavin SMTP runs the checks for you, from your own server, and says in plain words what is wrong and what to do:

* **Settings** — spots a missing password, a port that does not match its encryption, or a host typed as a web address.
* **Mail server name** — confirms the host exists, and warns when your server quietly points a provider's host at a private address.
* **Ports** — finds out whether your hosting company blocks the mail port, tells a firewall timeout apart from a refused connection, and finds a port that works.
* **Genuine server** — detects when your hosting company **intercepts outgoing mail** and answers with its own server instead of your provider's, and names the certificate that answered. This is the problem where every setting looks right but email still fails.
* **Login** — tests your username and password without sending an email, and explains the reply: a Google account that needs an App Password, Microsoft 365 with password login turned off, a server that wants encryption first.
* **HTTPS** — when SMTP is blocked, checks whether your server can still reach your provider over HTTPS.

**Find my settings** fills in the mail server details from your email address, including Google Workspace, Microsoft 365 and Zoho on your own domain.

= Features =

* Send WordPress email via any SMTP server (Outlook / Microsoft 365, SendGrid, Brevo, Mailgun, Amazon SES, Zoho and more).
* Dedicated **Google / Gmail** mailer — connect Gmail or Google Workspace with a Google **App Password** in seconds.
* **Connection Doctor** that finds out why email is not sending, including hosts that intercept outgoing mail.
* **Find my settings** that fills in your provider's server, port and encryption.
* Set a custom **From Email** and **From Name**, with an optional force override.
* SSL, TLS or no encryption, with a configurable port.
* Optional SMTP authentication (username / password).
* Built-in **test email** tool that surfaces the real error when a send fails.
* Store your SMTP password in `wp-config.php` (the `KVN_SMTP_PASSWORD` constant) instead of the database for extra security.
* Lightweight, no bloat, no account required.

= Developer friendly =

Kavin SMTP exposes hooks so other plugins can extend it:

* `kvn_smtp_mailers` — add mailer options.
* `kvn_smtp_mailer_config` — filter the SMTP config before it is applied.
* `kvn_smtp_before_configure` / `kvn_smtp_after_configure` — act on the PHPMailer instance.
* `kvn_smtp_render_mailer_sections` — add your own mailer's settings section to the form.
* `kvn_smtp_doctor_target` — let the Connection Doctor check your own mailer's SMTP connection.
* `kvn_smtp_doctor_result` — adjust a Connection Doctor result.
* `kvn_smtp_doctor_providers` — add a provider to the list the doctor and Find my settings know.
* `kvn_smtp_loaded` — run code once the plugin has booted.

== Installation ==

1. Upload the `kavin-smtp` folder to `/wp-content/plugins/`, or install the plugin through the Plugins screen in WordPress.
2. Activate the plugin through the **Plugins** screen.
3. Go to **Kavin Studios → SMTP** in the WordPress admin sidebar.
4. Enter your From Email/Name, then click **Find my settings** to fill in your provider's server details, or choose **Other SMTP** and enter them yourself.
5. Save, then use the **Send a Test Email** box to confirm delivery. If it fails, click **Run Connection Doctor** to find out why.

== Frequently Asked Questions ==

= Why is my email not sending? =

Click **Run Connection Doctor** on the settings screen. It checks, in order, your settings, the mail server's name, whether your host blocks mail ports, whether the server that answers is really your provider's, and whether your login is accepted. Each result says what is wrong and what to do.

= My settings are right, but email still fails. Why? =

Some hosting companies intercept outgoing SMTP and pass it through their own mail server. Your settings look correct, but WordPress refuses the connection because the certificate belongs to the host, not to your email provider. The Connection Doctor detects this and shows which certificate answered, so you can ask your host to allow outgoing SMTP.

= Does the Connection Doctor send email or share my data? =

No. It never sends an email, and nothing is sent to Kavin Studios. It only runs when you click the button. See **External services** below for exactly what it connects to.

= How do I connect Gmail? =

Choose the **Google / Gmail** mailer, enter your Gmail address, and paste a Google **App Password**. To create one, enable 2-Step Verification on your Google account, then generate an App Password at myaccount.google.com. Prefer OAuth ("Connect with Google") with no app password? That is available in Kavin SMTP Pro.

= Where do I find my SMTP settings? =

Click **Find my settings** — it recognises Gmail, Google Workspace, Microsoft 365, Outlook.com, Yahoo, iCloud and Zoho. Otherwise your email provider publishes them. Common examples: Gmail uses `smtp.gmail.com`, port 587, TLS (create an App Password); Outlook/Microsoft 365 uses `smtp.office365.com`, port 587, TLS.

= Can I hide my password from the database? =

Yes. Add `define( 'KVN_SMTP_PASSWORD', 'your-password' );` to `wp-config.php`. The field is then hidden in the admin and the constant is used instead.

= The test email failed. What now? =

The notice shows the actual SMTP error and a link to the **Connection Doctor**, which works out the cause for you. The most common causes are a port your host blocks, a wrong port/encryption combination (use 587+TLS or 465+SSL), incorrect credentials, or a provider that requires an app-specific password.

= Does it work with contact form and WooCommerce emails? =

Yes. Kavin SMTP hooks into the standard `wp_mail()` pipeline, so any plugin that sends mail through WordPress is routed via your SMTP server.

== External services ==

Kavin SMTP sends no data to Kavin Studios. It connects to outside services only in these cases.

**Sending email.** Every email your site sends goes to the SMTP server you enter in the settings (for the Google / Gmail mailer, `smtp.gmail.com`). That server receives the message, its recipients, and the username and password you saved. Sending email this way is the purpose of the plugin.

**Connection Doctor.** Only when an administrator clicks **Run Connection Doctor**, the plugin looks up the mail server's DNS records, connects to that server on its mail ports, reads its certificate and, if a login is saved, tests the login. No email is sent. If the mail ports turn out to be blocked or intercepted, and your mail server belongs to a provider listed below, it also makes one HTTPS request to that provider's API address (for example `gmail.googleapis.com`) to see whether HTTPS gets through. That request carries no personal data and not your site's address.

**Find my settings.** Only when an administrator clicks **Find my settings**, the plugin looks up the DNS MX records of the email address's domain, then opens a connection to the matching provider's SMTP server to see which port is reachable. No login is attempted and no email is sent.

Providers the Connection Doctor and Find my settings may connect to:

* Google (Gmail, Google Workspace) — [Terms](https://policies.google.com/terms), [Privacy Policy](https://policies.google.com/privacy)
* Microsoft (Microsoft 365, Outlook.com) — [Services Agreement](https://www.microsoft.com/servicesagreement), [Privacy Statement](https://privacy.microsoft.com/privacystatement)
* Yahoo Mail — [Terms](https://legal.yahoo.com/us/en/yahoo/terms/otos/index.html), [Privacy Policy](https://legal.yahoo.com/us/en/yahoo/privacy/index.html)
* iCloud Mail (Apple) — [Terms](https://www.apple.com/legal/internet-services/icloud/), [Privacy Policy](https://www.apple.com/legal/privacy/)
* Zoho Mail — [Terms](https://www.zoho.com/terms.html), [Privacy Policy](https://www.zoho.com/privacy.html)
* SendGrid (Twilio) — [Terms](https://www.twilio.com/en-us/legal/tos), [Privacy Policy](https://www.twilio.com/en-us/legal/privacy)
* Mailgun — [Terms](https://www.mailgun.com/legal/terms/), [Privacy Policy](https://www.mailgun.com/legal/privacy-policy/)
* Brevo — [Terms](https://www.brevo.com/legal/termsofuse/), [Privacy Policy](https://www.brevo.com/legal/privacypolicy/)
* Amazon SES (AWS) — [Service Terms](https://aws.amazon.com/service-terms/), [Privacy Notice](https://aws.amazon.com/privacy/)
* Postmark — [Terms](https://postmarkapp.com/terms-of-service), [Privacy Policy](https://postmarkapp.com/privacy-policy)

For any other mail server, the checks connect only to the host you entered.

== Screenshots ==

1. The Kavin SMTP settings screen — set your sender and choose how email is sent.
2. Send through Gmail or Google Workspace with an App Password.
3. Connect any SMTP server, then send a test email to confirm delivery.
4. The Connection Doctor finds out why email isn't sending, and says what to do.

== Changelog ==

= 1.1.0 =
* New: Connection Doctor. Finds out why email is not sending — a blocked port, a host that intercepts outgoing mail, a certificate problem or a rejected login — and says what to do. It never sends an email.
* New: Find my settings fills in the mail server details from your email address, including Google Workspace, Microsoft 365 and Zoho domains.
* A failed test email now links straight to the Connection Doctor.

= 1.0.2 =
* Settings now live under the shared **Kavin Studios** admin menu.
* Redesigned settings screen with a new header logo.
* Tested with WordPress 7.1.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.1.0 =
Adds the Connection Doctor, which finds out why email is not sending, and Find my settings.

= 1.0.2 =
Settings move to the Kavin Studios menu, with a redesigned settings screen.

= 1.0.0 =
Initial release.
