Retrieving e-mail using the Google API is just about trivial. You can generate a code snippet in Grok or what have you in about 30 seconds to do it.
Alternatively you can set up IMAP access.
Obviously you have to be able to configure proper OAuth2 keys to do this, but again, that's another 30 seconds spent in Grok/GPT/Claude/whatever.