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

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!

Advertisement

spot_img

How to Become a...

Why Become a WordPress Pro? WordPress is one of the...

Top Performing WordPress Cache...

Typically, the caching plugin that is considered the best...

Avoid these 6 common...

Explaining what makes a good hosting environment for WordPress...

WordPress Cron Job

Why not to use WordPress cron and why all...

CyberPanel and WordPress

What's better than Nginx? OpenLiteSpeed is better. CyberPanel is...

How to Install and...

If you're looking to create a website or blog,...

How to Become a WordPress Pro: A Step-by-Step Guide

Why Become a WordPress Pro? WordPress is one of the most popular content management systems (CMS) in the world. According to recent statistics, over 40%...

Top Performing WordPress Cache Plugins for Fast Website Loading

Typically, the caching plugin that is considered the best and fastest is the one that has a fast Time To First Byte (TTFB), effectively...

Avoid these 6 common issues to choose the best WordPress hosting for your website

Explaining what makes a good hosting environment for WordPress websites can be challenging, given the many different setups that can enable WordPress to run...

WordPress Cron Job

Why not to use WordPress cron and why all the fuzz? If you are running your own VPS or if you are on a shared...

CyberPanel and WordPress

What's better than Nginx? OpenLiteSpeed is better. CyberPanel is powered by OpenLiteSpeed and that is great news for WordPress. The faster server, the faster...

How to Install and Set Up WordPress for Beginners: A Step-by-Step Guide using cPanel and Softaculous

If you're looking to create a website or blog, WordPress is one of the most popular and user-friendly platforms to do so. But if...

WooCommerce PayPal credit card checkout for non US accounts

Yes, even if you don't have an US PayPal account you can have your customers checkout and pay with their Visa or other cards. We...

Newspaper 9.7 to 11 theme activation

Protect your privacy and never send your real activation code. GDPR and GPL is abused by the tagDiv team. Lucky us WordPress is an open source. <3

Newsmag 4.7 theme activation

For quite some time I have been wondering about this theme, so I decided to try it. I obtained an original copy of the...