Configure WP Mail SMTP pluggin with Gmail

If you want to use your Google Gmail account (nathabee123@gmail.com) to send WordPress emails instead of relying on your VPS mail server (Postfix), you can definitely configure WP Mail SMTP with Gmail. Here’s a simplified guide to configure it, and yes, it bypasses the need for additional Postfix tweaks.


Using Gmail as Your SMTP Email Provider

1. Install and Activate WP Mail SMTP Plugin

  1. Go to your WordPress dashboard.
  2. Navigate to Plugins > Add New.
  3. Search for WP Mail SMTP and click Install.
  4. Activate the plugin.

2. Configure WP Mail SMTP with Gmail

  1. Navigate to WP Mail SMTP > Settings.
  2. Set the From Email to nathabee123@gmail.com.
  3. Enable the option Force From Email to ensure all emails are sent from this address.
  4. Set the From Name to “Your Website Name” (e.g., Nathabee Creation).
  5. Select Gmail as the mailer.
  6. Save your settings.

3. Set Up a Google App for Gmail SMTP Access

To use Gmail as your SMTP provider, you need to allow WordPress access to your Gmail account securely.

This step is detailled in WP Mail SMTP Documentation

  1. Go to the Google Cloud Console: Visit Google Cloud Console.
  2. Create a New Project:
    • Click the Select a Project dropdown at the top.
    • Click New Project and give it a name (e.g., WordPress SMTP).
    • Click Create.
  3. Enable Gmail API:
    • Go to APIs & Services > Library in the left-hand menu.
    • Search for Gmail API and click on it.
    • Click Enable.
  4. Set Up OAuth Credentials:
    • Go to APIs & Services > Credentials.
    • Click Create Credentials > OAuth Client ID.
    • If prompted, configure a consent screen:
      • Select External and fill in the required details.
    • After setting up the consent screen, go back to Create Credentials > OAuth Client ID.
    • Choose Web Application.
    • Add an authorized redirect URI:
      • WP Mail SMTP provides this in its settings under WP Mail SMTP > Settings > Gmail. Copy the redirect URL (e.g., https://yourdomain.com/wp-admin/options-general.php?page=wp-mail-smtp) and paste it into the Authorized Redirect URIs field in the Google Cloud Console.
    • Click Create.
  5. Copy Client ID and Client Secret:
    • After creation, Google will show you the Client ID and Client Secret.
    • Copy both and paste them into WP Mail SMTP > Settings > Gmail in WordPress.
  6. Connect Your Gmail Account:
    • Save your WP Mail SMTP settings.
    • Click Allow plugin to send emails using your Gmail account.
    • Sign in with nathabee123@gmail.com and grant permissions.

4. Test Your Email Settings

  1. Go to WP Mail SMTP > Tools > Email Test.
  2. Enter a recipient email address (e.g., your Gmail or another address).
  3. Send a test email to verify that WordPress can send emails successfully.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *