Solved

Access Gmail with Indy

Posted on 2007-11-18
6
2,144 Views
Last Modified: 2012-05-05
Hello
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.POP3AuthenticationType.atUserPass;
 
 

//            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

0
Comment
Question by:amrelgarhy81
  • 3
  • 2
6 Comments
 
LVL 17

Accepted Solution

by:
TheRealLoki earned 50 total points
ID: 20310030
you need to download the opensource ssl dll's and put them in the search path.
here's some good info for you
http://www.delphi3000.com/articles/article_4374.asp?SK
http://www.intelicom.si/www.nsf/sub?readform&cat=9&lang=en
0
 
LVL 1

Author Comment

by:amrelgarhy81
ID: 20311057
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?
0
 
LVL 2

Assisted Solution

by:zorfael
zorfael earned 30 total points
ID: 20311708
make sure you indy component properties look like the settings on this sample:
http://www.marcocantu.com/tips/oct06_gmail.html
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Author Comment

by:amrelgarhy81
ID: 20312006
i did that, but it keep connecting and hang my application without any response.
0
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 20313845
the first link i posted shows how to use gmail with indy
0
 
LVL 1

Author Comment

by:amrelgarhy81
ID: 20313921
Look
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;

            nn.Connect();

        }
 
 

void nn_OnStatus(object ASender, Indy.Sockets.Status AStatus, string AStatusText)

        {

            MessageBox.Show(AStatusText);

        }

Open in new window

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now