For security reasons, Gmail only enables IMAP access if you tell Gmail you want to use IMAP access. So log into Gmail's web interface, click the gear icon and enable IMAP access on the IMAP settings page.
Need a walkthrough? See: https://support.google.com/mail/troubleshooter/1668960?hl=en#ts=1665018
The highlighted sections below should match this example, but you should use your real email address and password.
On the Options->Defaults screen you can specify your favorite email client to run when you press the "Run Email Client" button.
Most email clients can take a URL as a command line parameter. Most email clients are in the system path, so you just need the executable name and the url of the website to launch:
For example:
If you have more than one linked gmail account, the url needs to be changed to somethibg a little more complicated: https://mail.google.com/mail/u/1/ will launch the second account, https://mail.google.com/mail/u/2/ the third, and so on.