# Set up Gmail as an Email Server

Cloud Voice can route its outbound email through your own Gmail account. This page walks you through generating a Google app password and then pointing Cloud Voice at Gmail's SMTP service (SMTP, short for Simple Mail Transfer Protocol, is the standard used to send email) so the system can send notifications, voicemail alerts, and similar messages from your address.

## Before you begin

Confirm that your Cloud Voice system is able to reach Google's servers over the network. If the system cannot reach Google, the connection test in Step 2 will fail no matter how the settings are entered.

## Step 1. Generate an app password in your Google Account

Google blocks direct password sign-in for third-party services, so Cloud Voice authenticates with a dedicated app password instead of your normal Gmail password. Enabling 2-Step Verification is a prerequisite for creating one.

:::note
An app password is a dedicated 16-character code that lets one specific app or device sign in to your Google Account. The **App passwords** option only appears after 2-Step Verification is switched on, so complete that part first.
:::

:::caution
Turning on 2-Step Verification changes how this Google Account signs in everywhere, not just for Cloud Voice. From now on anyone who uses this mailbox is asked for a second factor (such as a phone prompt or a code) at login. If this is a shared company mailbox, confirm that whoever manages it expects the change and can complete the second step, otherwise they may be locked out.
:::

1. Sign in to your [Google Account](https://myaccount.google.com/) with the Gmail credentials you want Cloud Voice to use.
2. In the left-hand menu, select **Security**.
3. Enable 2-Step Verification:
   1. Under **Signing in to Google**, click **2-Step Verification** and re-enter your Gmail password when prompted.
   2. On the **2-Step Verification** page, click **GET STARTED** and confirm your password again.
   3. Choose a verification method and follow the on-screen prompts to verify your account.
   4. Click **TURN ON** to finish enabling 2-Step Verification.

      ![The 2-Step Verification confirmation screen with the option turned on](/images/pbx/turn-on-2-step-verification.png)
4. Use the back arrow ![Google back button](/images/pbx/google-back.png) at the top of the page to return to the **Security** page.
5. Create the app password:
   1. Under **Signing in to Google**, click **App passwords** and verify your Gmail password once more.
   2. Open the **Select app** drop-down and choose **Other (Custom name)**.
   3. Type a label that will help you recognize the entry later, for example `Cloud Voice PBX`. (PBX stands for Private Branch Exchange, the term for your business phone system.)
   4. Click **GENERATE**.

      
      ![Cloud Voice, the custom-name field ready to generate an app password](/images/pbx/gmail-generate-app-psw.png)

Google displays the new 16-digit app password. Copy it and keep it somewhere safe, because you will paste it into Cloud Voice in the next step.

![The generated 16-digit Google app password](/images/pbx/gmail-app-password.png)

:::caution
Copy the app password before you leave this screen. Google shows it only once, and there is no way to look it up again afterward. If you lose it, delete the entry and generate a new one. Treat the code like a password, because it grants access to your mailbox.
:::

## Step 2. Point Cloud Voice at the Gmail server

With the app password in hand, configure Cloud Voice to send through Gmail.

1. Sign in to the Cloud Voice web portal and go to **System > Email > Email Server**.
2. Set **Type of Email Server** to **Custom Email Server**.
3. Set **Select Email Server Provider** to **General**.
4. Fill in the server details:
   - **Sender Email Address**: Your Gmail address. This is the From address recipients see on messages sent by Cloud Voice.
   - **Email Address or Username**: Your Gmail address.
   - **Password**: The 16-digit app password you generated in Step 1, not your normal Gmail password.
   - **Outgoing Mail Server (SMTP)**: Leave the default value `smtp.gmail.com`.
   - **Port**: Leave the default value `587`.
   - **Enable TLS Encryption**: Leave this option cleared. (TLS, short for Transport Layer Security, encrypts the connection to the mail server.)

   :::caution
   Leave **Enable TLS Encryption** cleared while port is set to `587`. On this port Gmail upgrades the connection to an encrypted one automatically (a method called STARTTLS), so the separate toggle should stay off. Turning it on tells Cloud Voice to open an encrypted connection immediately, which does not match port `587` and makes the test fail.
   :::
5. Send a test message to confirm the connection:
   1. Click **Test**.
   2. In the dialog that opens, type a destination address in the **Email Address** field.
   3. Click **Test**.

   :::tip
   Send the test message to an inbox you can open right away, so you can confirm the email actually arrives and is not held or filtered.
   :::
6. Click **Save**.

## What to expect

- On success, the page shows "Success" and the address you tested receives the message.
- On failure, the page shows "Failed to send" along with an error message. For more detail on why delivery failed, review the [Email Sent Logs](/pbx/administrator-guide/email-sent-logs/).
