Accessing Gmail SMTP / IMAP from your application

Reading Time: 3 minutes

This article describes the Gmail SMTP / IMAP settings needed to send emails from a third party application (like OfficeClip)

Gmail is not the ideal way to send emails from another applications. To minimize spam google has introduced many restrictions:

  • 500 emails per day for a free Gmail account
  • 1000 emails per day for paid G Suite account

Also, without warning google is known to temporarily disable your Gmail account if it suspects you are using it for sending mass emails.

To send emails from your Gmail account you have the following options:

  1. Use App Password
  2. Use OAuth2 Authentication

1. Use App Password

Another way to allow applications to use your Gmail credentials to send emails is to create an application password in Gmail settings. Then you can use this password with the application. You can also disable it if you do not need it in the future. Rest of your Gmail remains secured. To implement this:

  1. Enable 2-Step authentication in your Gmail account. Follow this article to set it up
  2. Go to your Google Accounts
  3. Select Security

  4. Under Signing in to Google, Click on App passwords
  5. Select Other for App and give a name
  6. Click on Generate
  7. Copy the App Password and put it in your application as your password. Note that this is only shown once.

You can also see this article for more explanation.

2. Use OAuth2 authentication

OAuth 2.0, is an acronym for “Open Authorization”, is a standard to allow an application or website to access resources hosted by other trusted entities on behalf of a user.

OfficeClip’s OAuth 2.0 authentication is in the beta stage and not fully approved by Google yet. In order to use it you will need to bypass the Google default security mechanism.

Follow these steps:

  1. In Email > Admin > New Accounts, Click on New Account ‌
    Add New Account
    Figure: Add New Account
  2. Click on Authorize Google Account
    Authorize Google Account
    Figure: Authorize Google Account
  3. On the next screen, you will see a message that Google has not verified the application. The application is put into beta till the process is complete. To go further click on the advanced link at the bottom of the screen.
    advanced option
    Click advanced option
  4. The screen expands with another warning about using this unsafe option. In the beta version this warning will show. When approved this warning will go away.
    Google unverified application
  5. Finally click on Allow

4. Use another provider

Google is restrictive in terms of SMTP access from third party providers. There are other providers that can give you SMTP access. Some of them have free plans that may be enough for your team. See this article for other SMTP providers.