How to Use Gmail SMTP to Send Email in WordPress

WordPress users have a lot of trouble in getting mails from visitors via the forms they fill up on their site or other such means. This happens because WordPress uses the wp_mail() function which basically follows the standard PHP mail() function. This usually ends up sending the mails on the clients’ servers.

This can get very tricky.  But WordPress experts caught on to this glitch fairly quickly and fixed it by created a small albeit handy plugin. That awesome plugin is WP Mail SMTP. What this plugin does is it redirects all the mails to be sent by visitors through filling forms or any other such means to a selected Google account that has been chosen by you.

By doing so, you can send email via SMTP to all the visitors who fill up the forms on your site. This article will guide you to use Gmail SMTP to send Email in WordPress.

Step 1: Install WP Mail SMTP on your WordPress backend

wp mail smtp

Step 2: Visit the Settings tab of this plugin and fill in the following details

Advanced Email options

The options in the Settings Tab are:

  1. From Email

This is the email you want the visitors to receive email from.

  1. From Name

The name that you want to appear for the Email, it could either be the site name or your own name.

  1. Mailer

This option covers whether you want to use SMTP or PHP () mail settings.

  1. Return Path

This option covers whether you want to match the return path with the “From Email” or not.

  1. SMTP options

The host and port for SMTP have already been defined by default they are:


Port: 465

  1. Encryption

These settings depend on the encryption settings that you have chosen for your server.

  1. Authentication

If you want to use SMTP authentication, then you would have to create a username and password for the same.

  1. Send a Test Email

Once you are done choosing options for your SMTP settings you can send out a test mail to see if the settings are working according to you.

Simply save all these settings and you are all set for a smooth mailing experience with your site visitors.