Nav

Connecting to Gmail

The examples here provide guidance on setting up a Gmail connection using the Email connector over the available protocols.

Gmail Configurations

By default, Google might block third-party mail clients. For Google to authorize a third-party server to access your account, you must enable Less Secure Apps on your Gmail account. You can read a full explanation of the risks involved and get a full explanation here, which essentially says Google blocks any apps that are not using security protocols that Google deems mandatory unless they allow "less secure apps" to access your Gmail account.

So when you try to connect for the first time, you will receive an email that contains a link for enabling Less Secure Apps in your account.

Email notification from Google about the blocked sign-in attempt

You can also enable Less Secure Apps from here:

"MyAccount" > "Sign-in & security" > "Connected apps & sites" > "Allow less secure apps"

IMAP Configuration

Required parameters:

  • Gmail IMAP server address: imap.gmail.com

  • Gmail IMAP username: Your full Gmail address (for example, `user@gmail.com`).

  • Gmail IMAP password: Your Gmail password.

  • Gmail IMAP port (SSL): 993


          
       
1
2
3
4
5
6
7
8
9
<email:imap-config name="gmail">
  <email:imaps-connection host="imap.gmail.com"
    port="993" user="user@gmail.com"
    password="mypassword">
    <tls:context>
        <tls:trust-store insecure="true"/>
    </tls:context>
  </email:imaps-connection>
</email:imap-config>

POP3 Configuration

Required parameters:

  • Gmail IMAP server address: imap.gmail.com

  • Gmail IMAP username: Your full Gmail address (for example, `user@gmail.com`).

  • Gmail IMAP password: Your Gmail password.

  • Gmail IMAP port (SSL): 995


          
       
1
2
3
4
5
6
7
8
9
<email:pop3-config name="gmail">
    <email:pop3s-connection host="pop.gmail.com"
      port="995"  user="user@gmail.com"
      password="mypassword">
        <tls:context>
            <tls:trust-store insecure="true"/>
        </tls:context>
    </email:pop3s-connection>
</email:pop3-config>

SMTP Configuration

Required parameters:

  • Gmail SMTP server address: smtp.gmail.com

  • Gmail SMTP username: Your full Gmail address (for example, `user@gmail.com`).

  • Gmail SMTP password: Your Gmail password.

  • Gmail SMTP port (SSL): 465


          
       
1
2
3
4
5
6
7
8
9
<email:smtp-config name="smtp-gmail" from="sender@gmail.com">
    <email:smtps-connection host="smtp.gmail.com"
      port="465" password="mypassword"
      user="juandesi@gmail.com">
        <tls:context>
            <tls:trust-store insecure="true"/>
        </tls:context>
    </email:smtps-connection>
</email:smtp-config>

In this topic: