Error-Free Setup of Gmail SMTP for WordPress Emails: A Step-by-Step Guide

593

Yes, it is possible to configure Gmail SMTP via wp-config so that all emails sent from your website go through Gmail. Here are the steps:

  1. Log in to your Gmail account and navigate to the “Less secure apps” settings page.
  2. Turn on the “Allow less secure apps” option.
  3. Generate an App password for your WordPress website by following the instructions on this page: https://support.google.com/accounts/answer/185833
  4. Open your wp-config.php file and add the following lines:
define( 'WP_MAIL_SMTP_AUTH', true );
define( 'WP_MAIL_SMTP_SECURE', 'tls' );
define( 'WP_MAIL_SMTP_PORT', 587 );
define( 'WP_MAIL_SMTP_HOST', 'smtp.gmail.com' );
define( 'WP_MAIL_SMTP_USERNAME', 'your-gmail-address@gmail.com' );
define( 'WP_MAIL_SMTP_PASSWORD', 'your-gmail-app-password' );

Replace “your-gmail-address” with your actual Gmail address and “your-gmail-app-password” with the app password you generated in step 3.

Save the changes to your wp-config.php file.

After completing these steps, all emails sent from your WordPress website will be sent through Gmail SMTP.

All Done!

LEAVE A REPLY

Please enter your comment!
Please enter your name here

CAPTCHA