(06-25-2022, 10:58 PM)Boba TC Wrote: I do not want to test my IMAP4 'skills' on real mail boxes; so created a test gmail one, enabled IMAP, but need more help: can not login to it.
Per https://support.google.com/accounts/answer/6010255:
Quote:To help keep your account secure, from May 30, 2022, Google no longer supports the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password.
So, you have three choices:
- go into your Gmail account and turn "less secure apps" back on. Then you can login with your Gmail username and password as before.
- go into your Gmail account and turn on 2FA and create an app-specific password. Then you can login with your Gmail username and app password.
- implement OAuth2 in your code. See https://developers.google.com/identity/protocols/oauth, and have a look at https://github.com/geoffsmith82/GmailAuthSMTP/, which should be adaptable for IMAP, not just SMTP. Also see this branch https://github.com/indysockets/indy/tree/sasl-oauth in Indy's repo.
(06-26-2022, 12:19 AM)Boba TC Wrote: I think google requires SASL now. The IDE Tool Palette does have 'Indy SASL' components but no mentioning of OAuth2. Am I doomed with RAD Studio 2009?
https://github.com/geoffsmith82/GmailAuthSMTP/
https://github.com/indysockets/indy/tree/sasl-oauth
(06-26-2022, 04:15 AM)Boba TC Wrote: from my example above
...
what is the correct C++ syntax of TIdIMAP4::SendCmd method?
Try this:
Code:
s2 = IdIMAP4->SendCmd(IdIMAP4->NewCmdCounter, "FETCH 10:20 (FLAGS)", OPENARRAY(String, ("FETCH")));
Or, you can omit the counter and TIdIMAP4 will generate one for you:
Code:
s2 = IdIMAP4->SendCmd("FETCH 10:20 (FLAGS)", OPENARRAY(String, ("FETCH")));