How to setup wp mail smtp gmail

To set up WordPress to use Gmail's SMTP server for sending emails, you'll need to follow these steps:

Step 1: Create a Gmail account and enable less secure apps

  1. Create a new Gmail account or use an existing one.
  2. Go to the Google Account settings page and sign in with your Gmail account.
  3. Click on the "Security" tab.
  4. Scroll down to the "Less secure app access" section and toggle the switch to "On".

Step 5: Generate an App Password

  1. Go to the Google Account settings page and sign in with your Gmail account.
  2. Click on the "Security" tab.
  3. Scroll down to the "Signing in to Google" section.
  4. Click on "App passwords".
  5. Select "Mail" as the app type.
  6. Select "Other" as the device type.
  7. Enter a name for the app password (e.g., "WordPress").
  8. Click "Generate".
  9. Note down the generated app password.

Step 2: Install and configure the WP Mail SMTP plugin

  1. Install the WP Mail SMTP plugin from the WordPress plugin directory or by uploading it manually.
  2. Activate the plugin.
  3. Go to the plugin's settings page by clicking on "WP Mail SMTP" in the WordPress admin menu.
  4. Enter your Gmail address and password in the "SMTP Settings" section.
  5. In the "SMTP Authentication" section, select "Username and Password" and enter your Gmail address and the app password you generated earlier.
  6. Set the "SMTP Port" to 587 (or 465 if you're using SSL).
  7. Set the "SMTP Encryption" to "TLS" (or "SSL" if you prefer).
  8. Click "Save Changes".

Step 3: Configure the WordPress settings

  1. Go to the WordPress admin menu and click on "Settings" > "General".
  2. In the "Mail Settings" section, select "WP Mail SMTP" as the mailer.
  3. Set the "From Email" and "From Name" fields to your desired values.
  4. Click "Save Changes".

Step 4: Test the email sending

  1. Go to the WordPress admin menu and click on "Tools" > "Mail Tester".
  2. Fill in the test email form with your desired recipient's email address and a test message.
  3. Click "Send Test Email".
  4. If everything is set up correctly, you should receive the test email in your inbox.

That's it! Your WordPress site should now be using Gmail's SMTP server to send emails.