The most simple scenario you can experience when implementing Email service synchronization for your Dynamics 365 organization is having Exchange Online in the same tenant. This is the most simple case and it takes few minutes for administrator to set up email synchronization for the whole organization (all users). But what about having to sync Exchange online server which is not in the same tenant or other servers such as Gmail?
The good news is that Exchange Online synchronization is supported even if it’s not in the same tenant. The bad news is that each user has to enter his credentials in order to get his emails and appointments synchronized.
Whether it’s Exchange Online, Gmail or another provider, the first step is to get POP3/SMTP settings and create a new Mailbox Profile in Dynamics 365 and once related mailboxes are approved you can ask your users to enter their credentials so they can synchronize their appointments and emails.
This Microsoft links is listing all the supported scenarios whether you are online or on-premises.
The following link explains step by step how to set up the synchronization for a gmail server
.