---
tags:
  - wordpress
  - email
  - smtp
  - plugin
  - ubuntu
  - notifications
---

# Setting Up Reliable Email Notifications for WordPress (SMTP)

By default, WordPress tries to send emails (like password resets and contact form notifications) using the server's internal PHP `mail()` function. On most cloud servers and local environments, this **fails completely** or sends your emails straight to the Spam folder because the server isn't a trusted email sender.

The solution is to use **SMTP (Simple Mail Transfer Protocol)** to route your WordPress emails through a legitimate email provider like Gmail, Outlook, or SendGrid.

## 1. Install an SMTP Plugin

We need a plugin to hijack the default WordPress email function and force it to use SMTP. **WP Mail SMTP** is the industry standard.

1.  Log in to your WordPress Dashboard.
2.  Go to **Plugins -> Add New**.
3.  Search for **"WP Mail SMTP"**.
4.  Click **Install Now** and **Activate**.

## 2. Choose Your Mailer

Upon activation, the Setup Wizard will launch. You can use it, or configure it manually.

*   **For Personal/Low Volume:** **Google / Gmail** is excellent and free.
*   **For Business/High Volume:** **SendLayer**, **Brevo** (formerly Sendinblue), or **SendGrid** are recommended.
*   **For Generic Hosts:** Select **"Other SMTP"** if you want to use your web host's email (e.g., `admin@yourdomain.com`).

## 3. Configuration Example: Using Gmail (Free)

Using your personal Gmail account is the easiest way to get started without signing up for a new service.

### Step A: Create an App Password
Google no longer allows you to just use your normal password for security reasons. You must generate a specific "App Password".

1.  Go to your **Google Account** settings (myaccount.google.com).
2.  Go to **Security**.
3.  Enable **2-Step Verification** if it isn't already.
4.  Search for **"App Passwords"** in the search bar at the top.
5.  Create a new app password. Name it "WordPress".
6.  Copy the 16-character code it gives you.

### Step B: Configure Plugin
1.  In WordPress, go to **WP Mail SMTP -> Settings**.
2.  **From Email:** Enter your Gmail address.
3.  **From Name:** Enter your site name.
4.  **Mailer:** Select **Other SMTP**.
5.  **SMTP Host:** `smtp.gmail.com`
6.  **Encryption:** `TLS`
7.  **SMTP Port:** `587`
8.  **Authentication:** On.
9.  **SMTP Username:** Your full Gmail address.
10. **SMTP Password:** Paste the 16-character App Password you generated (remove spaces).
11. Click **Save Settings**.

## 4. Send a Test Email

Never assume it works. Always test.

1.  Go to the **Email Test** tab in the plugin settings.
2.  Enter your own email address.
3.  Click **Send Email**.
4.  Check your inbox. If you see the email (and it's not in Spam), your setup is complete.

## 5. Troubleshooting

*   **Connection Timed Out:** Your server firewall might be blocking the SMTP port.
    *   *Fix:* Allow outgoing traffic on port 587.
*   **Authentication Failed:** You likely copied the password wrong or didn't use an App Password.