# How to Connect Gmail

Connecting Google's SMTP is quite easy and you can either connect your Gmail or G Suite account for this case and by following just these 5 steps below, you'll accomplish this integration:

1. Create a Web App in your Google account
2. Configure your OAuth Consent Screen
3. Set up your OAuth Client ID
4. Updating the Publishing Status From Testing to Production
5. Create, copy and integrate Google's SMTP

### Create a Web App in Your Google Account <a href="#create-app" id="create-app"></a>

First of all, you need to open a new tab and log in your Gmail account or the G Suite account to access your inbox, then visit the Google console website to enable the Gmail API, you can click here to access the [direct link to that application page](https://console.developers.google.com/flows/enableapi?apiid=gmail\&pli=1).

If it’s your first time using Google Cloud Console, you may see a popup asking you to select your country and agree to the Terms of Service. Go ahead and do so, then click on **AGREE AND CONTINUE** to move on to the next step.

<figure><img src="https://2430774507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMvULxRbZfmag_jD1k_%2Fuploads%2Fo2dxVp8Rxy8bVIDiTg1h%2F2023-05-15_11-02-49.png?alt=media&#x26;token=ba7bafaa-0007-4255-a50e-64e917adf091" alt=""><figcaption></figcaption></figure>

#### **Creating or Choosing a Project**

You’ll need to choose a project to use for your app. You can select an existing one or create a new one.

To do so, click on the projects dropdown in the toolbar at the top of your dashboard. In the popup that appears, select an existing project from the list or click on **New Project** in the top right corner.

<figure><img src="https://2430774507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMvULxRbZfmag_jD1k_%2Fuploads%2F955bNmRGgAD3fKECoMBe%2FScreenshot_48.png?alt=media&#x26;token=a526c9b6-ae01-4858-acaf-92aabf2c2cae" alt=""><figcaption></figcaption></figure>

If you selected an existing project, move on to the next step. For a new project, enter a project name and location from the dropdowns. Then click on the **CREATE** button.

<figure><img src="https://2430774507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMvULxRbZfmag_jD1k_%2Fuploads%2FI8M3GW4IYNiiPKSOsHPz%2F2023-05-15_10-27-48.png?alt=media&#x26;token=68b76f01-8a3b-4b15-a68a-c2f9ff57bab1" alt=""><figcaption></figcaption></figure>

#### **Enabling the Gmail API**

Next, you need to enable the Gmail API for your project. Choose **APIs & services > Library** from the left side menu

<figure><img src="https://2430774507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMvULxRbZfmag_jD1k_%2Fuploads%2FxcvOew9MTRJFdNi0X7AX%2FScreenshot_49.png?alt=media&#x26;token=412e8ccb-b822-47fd-b1c5-b99909d2db4c" alt=""><figcaption></figcaption></figure>

Choose Gmail API and click on blue ENABLE button.

<figure><img src="https://2430774507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMvULxRbZfmag_jD1k_%2Fuploads%2Fg45ljBP5rBZeOrOQIXDU%2FScreenshot_50.png?alt=media&#x26;token=c85bf133-f8aa-4f68-aa9b-4809d80807ff" alt=""><figcaption></figcaption></figure>

#### **Creating Your Application’s Credentials**

After you enable the Gmail API, you should be redirected to the Gmail API Overview page. Here, click on the **CREATE CREDENTIALS** button.

<figure><img src="https://2430774507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMvULxRbZfmag_jD1k_%2Fuploads%2FSLzhLJGCKdUwYD56sFx8%2FScreenshot_51.png?alt=media&#x26;token=6e6cdff7-56a8-48c0-ac8b-0eb18d2da525" alt=""><figcaption></figcaption></figure>

On the next screen, you'll have to answer some questions, just leave them as you see below, then click the **NEXT** button to proceed.

![](https://2430774507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMvULxRbZfmag_jD1k_%2Fuploads%2FWa134X0N1tQst1q88DVQ%2FScreenshot_52.png?alt=media\&token=d3e1989b-b5eb-43bd-b792-bc6aeb6ff9da)

**Note:** If you don't see the Gmail API in that dropdown, make sure you have the [*Gmail API enabled*](#enabling-the-gmail-api) for your account.

### Configure **OAuth Consent Screen**

#### **OAuth Consent Screen**

Here, Gmail will then ask for some basic information about your app, fill the data as in our sample below. Then click on the **SAVE AND CONTINUE** button to proceed to the next step.

![](https://2430774507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMvULxRbZfmag_jD1k_%2Fuploads%2F8vzlgNwOTWEJdZlbmc8O%2F2023-05-15_11-14-40.png?alt=media\&token=fe39100f-28dc-4e83-a415-42970fdcd25e)

#### **Scopes (Optional)**

The next screen will require you to set the **Scopes (Optional),** but leave as it is, just click **Save and Continue .**

<figure><img src="https://2430774507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMvULxRbZfmag_jD1k_%2Fuploads%2FxeKsDfXi3cwnfDeirfOg%2FScreenshot_53.png?alt=media&#x26;token=c0601343-dea6-4428-8edb-3bdca08097dc" alt=""><figcaption></figcaption></figure>

### **Configure Your OAuth Client ID**

You'll need to fill out some information about your OAuth Client ID.

From the **Application type** dropdown, select the **Web application** option, then giving a name or leave at default **Web client 1.**

<figure><img src="https://2430774507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMvULxRbZfmag_jD1k_%2Fuploads%2FnaTdcrenX3ETldpju85I%2FScreenshot_55.png?alt=media&#x26;token=3b0dcce5-b123-49c0-baea-a47012605b33" alt=""><figcaption></figcaption></figure>

Next, skip the **Authorized JavaScript origins** section and scroll to **Authorized redirect URIs**.

Click on the **+ ADD URI** button and input the following, **Authorized redirect URLs** should contain the automatically generated URL in your site settings.

You'll see the settings when you go back to the YaySMTP settings screen in your website and make sure you click  **"enter"** button to add it too. Then click on the **CREATE** button to complete this step.

![](https://2430774507-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MMvULxRbZfmag_jD1k_%2F-MORXjBSOr0ZpqIvEeii%2F-MORYKLTbKqQKsryGL7U%2F6-YaySMTP%20Gmail%20setting%20screen.png?alt=media\&token=3fa8b5e0-171c-48bb-9c9b-48e2ec7df463)

After that, the **Credentials** will expand to show you your Client ID. Go ahead and click the **DONE** button.

![](https://2430774507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMvULxRbZfmag_jD1k_%2Fuploads%2FGa1dJlKKdwXNo680CL9S%2F2023-05-15_13-57-43.png?alt=media\&token=540d526b-af46-4a9d-ac10-d8372357abbf)

### Updating the Publishing Status From Testing to Production

In your Google Cloud Console sidebar, go to **APIs & Services > OAuth consent screen**. Under **Publishing status**, click on the **PUBLISH APP** button.

<figure><img src="https://2430774507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMvULxRbZfmag_jD1k_%2Fuploads%2FwWe0DxNlJEy6ICuv79L3%2FScreenshot_56.png?alt=media&#x26;token=469e5de5-45f6-4f8c-919e-9abd21efd138" alt=""><figcaption></figcaption></figure>

In the popup window that appears, click on **CONFIRM**.

<figure><img src="https://2430774507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMvULxRbZfmag_jD1k_%2Fuploads%2FO7YXXH0enFKZgzBQXTw2%2FScreenshot_57.png?alt=media&#x26;token=f3788183-652b-428d-afe0-e90384b22a3b" alt=""><figcaption></figcaption></figure>

Once confirmation is complete, you’ll see that your app’s Publishing status is now **In production**.

<figure><img src="https://2430774507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMvULxRbZfmag_jD1k_%2Fuploads%2F1bTl5Ou1xd7u5PpPIdL1%2FScreenshot_58.png?alt=media&#x26;token=1f40bc86-f4f8-4235-8eb5-5c24882677cc" alt=""><figcaption></figcaption></figure>

### **Create, copy and integrate Google's SMTP**

Click on **Credentials** in the left side menu, you will see the details of web application you just created in the **OAuth 2.0 Client IDs.**

Then, click the **pencil** icon to open all of the details, to edit and copy your credential values including **Client ID** and **Client Secret** (**Client Secret** is the **API Key** in YaySMTP settings)

<figure><img src="https://2430774507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMvULxRbZfmag_jD1k_%2Fuploads%2FGUxLKuLjEiT8UoCTtaLU%2F2023-05-15_14-15-23.png?alt=media&#x26;token=191f06d3-f0fa-4b68-b0a5-b57e6805b3ae" alt=""><figcaption></figcaption></figure>

Add them to the appropriate settings fields of YaySMTP on your website, click **"Save Changes".**

<figure><img src="https://2430774507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMvULxRbZfmag_jD1k_%2Fuploads%2F434sB5rjXOYIWlnBbQWi%2F2023-05-15_14-19-18.png?alt=media&#x26;token=674293a7-d049-463d-ae04-8a359146d11e" alt=""><figcaption></figcaption></figure>

When change is saved successfully, click on "**Confirm Authorization**" button to authorize the Google app.

<figure><img src="https://2430774507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMvULxRbZfmag_jD1k_%2Fuploads%2Fqom2BW0IXDKu1eh2NPEk%2F2023-05-15_14-21-33.png?alt=media&#x26;token=6c11ff33-e3e9-495d-9bb8-b1f226f5154b" alt=""><figcaption></figcaption></figure>

This will open a login screen for Google. Go ahead and log in to the account you’re setting up SMTP with, then click the **Allow** button to proceed.

**Bypassing Google’s Verification Warning (Free Gmail Users Only)**

You might see the following screen if you are connecting with a free Gmail account. Go ahead and click on the **Advanced** link in the bottom left corner.

<figure><img src="https://2430774507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMvULxRbZfmag_jD1k_%2Fuploads%2F4jxMLL81JrSmNDZ8J4jQ%2F2023-05-15_14-25-18.png?alt=media&#x26;token=480e2109-9c28-4b5f-9c7f-169c42e9f0eb" alt=""><figcaption></figcaption></figure>

In the expanded section, click on **Go to (your domain) (unsafe).**

<figure><img src="https://2430774507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMvULxRbZfmag_jD1k_%2Fuploads%2FCDLCeCl8yeOj2OV54TFf%2F2023-05-15_14-28-04.png?alt=media&#x26;token=128080b4-f44a-4f44-b7c3-380ca701ddba" alt=""><figcaption></figcaption></figure>

Then Click on Continue to complete Settings.

<figure><img src="https://2430774507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMvULxRbZfmag_jD1k_%2Fuploads%2Ff6i9DzwYmFjMZxywFjvR%2F2023-05-15_14-29-18.png?alt=media&#x26;token=bda2f974-96d3-47f2-93b7-d2e9c4a58f13" alt=""><figcaption></figcaption></figure>
