Gmail Setup IMAP

1. Open your Gmail Account 2. Click Settings (gear icon at upper right corner) > Settings 3. Click tab "Forwarding and POP/IMAP" 4. At "IMAP Access" > Click Enable IMAP 5. Click Save Settings for Incoming Mail (IMAP) Server: imap.gmail.com, Requires SSL: Yes, Port: 993 Settings for Outgoing Mail (SMTP) Server: smtp.gmail.com, Requires SSL: Yes, Requires TLS: Yes (if available), Requires Authentication: Yes, Port for SSL: 465, Port for TLS/STARTTLS: 587 Reference for Gmail Setup IMAP in this link: https://support.google.com/mail/answer/7126229?hl=en&visit_id=1-636658587365329866-366805787&rd=1#ts=1665018,1665137,2769074
See other articles in G Suite Support, Troubleshooting.