• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2170
  • Last Modified:

Access Gmail with Indy

I am trying to use Indy "http//:www.indyproject.org" to read mails from my gmail.
In a .Net 2.0 windows application.
I added the Indy dll file and i can access my company mail but not the gmail.
My gmail allow pop3.

The problem is that gmail needs ssl and don't know how to do using indy.

Any one tell me the problem in my code?

Indy.Sockets.POP3 nn = new Indy.Sockets.POP3();
            nn.Username = "myMail@gmail.com";
            nn.Password = "mypassword";
//            Indy.Sockets.TIdIOHandlerTls ioSSLHandler = new Indy.Sockets.TIdIOHandlerTls();
            //ioSSLHandler.PassThrough = false;
//            ioSSLHandler.Options.Protocol = Mono.Security.Protocol.Tls.SecurityProtocolType.Tls;
//            nn.IOHandler = ioSSLHandler;
            nn.Connect("pop.gmail.com", 995);

Open in new window

  • 3
  • 2
2 Solutions
TheRealLokiSenior DeveloperCommented:
you need to download the opensource ssl dll's and put them in the search path.
here's some good info for you
amrelgarhy81Author Commented:
put them where?
I put them in the application path, but i think i should change somthing in the the code.

You have an idea?
make sure you indy component properties look like the settings on this sample:
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

amrelgarhy81Author Commented:
i did that, but it keep connecting and hang my application without any response.
TheRealLokiSenior DeveloperCommented:
the first link i posted shows how to use gmail with indy
amrelgarhy81Author Commented:
I wrote it like that and its not working with me, it keep connecting without any response.

private void ConnectToGMail()
            Indy.Sockets.POP3 nn = new Indy.Sockets.POP3();
            nn.Username = "UserEmail";
            nn.Password = "password";
            nn.Host = "pop.gmail.com";
            nn.Port = 995;
            nn.OnStatus += new Indy.Sockets.TIdStatusEvent(nn_OnStatus);
            Indy.Sockets.TIdIOHandlerTls ioSSLHandler = new Indy.Sockets.TIdIOHandlerTls();
            ioSSLHandler.PassThrough = false;
            ioSSLHandler.Options.Protocol = Mono.Security.Protocol.Tls.SecurityProtocolType.Tls;
            nn.IOHandler = ioSSLHandler;
            nn.UseTLS = Indy.Sockets.UseTLS.utUseExplicitTLS;
void nn_OnStatus(object ASender, Indy.Sockets.Status AStatus, string AStatusText)

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now