Access Pop3 gmail server from a Delphi XE2 application

I try to access a gmail account to read and process incoming emails in Delphi XE2
I activated OPO3 for the gmail account
My code is like this :

begin
  SSL := TIdSSLIOHandlerSocketOpenSSL.Create(Application);
  Pop3 := TIDPop3.Create(Application);
  with Pop3 do
    begin
      AuthType  := patSASL;
      Host      := 'pop.gmail.com';
      UserName  := 'username@gmail.com';
      Password  := 'theusernamepassword';
      Port      := 995;
      IOHandler := SSL;
      UseTLS    := utUseImplicitTLS;
      Connect;
    end;
end;

On the Connect call, I get error EidSASLMechNeed with text (I translate it from french) : SASL mechanism needed for the connection
I have the needed libraries libeay32.dll and ssleay32.dll (dated december 201)

Any idea what is wrong ?
LVL 1
LeTayAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sinisa VukSoftware architectCommented:
Look at this article by Remy (Indy) where are few giudes what you need to add to run SASL.

More threads to read on Emb forum:
https://forums.embarcadero.com/thread.jspa?threadID=107724
https://forums.embarcadero.com/thread.jspa?threadID=228965
https://forums.embarcadero.com/message.jspa?messageID=651939

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
LeTayAuthor Commented:
Well I am an expert at all in that area
An example to access gmail server with POP should be helpful for me
LeTayAuthor Commented:
Looks like the third is the good one : https://forums.embarcadero.com/message.jspa?messageID=651939
Will test is now !
Sinisa VukSoftware architectCommented:
Remy = Indy :-)  So, best person to help. Not much here on EE thought....
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.