?
Solved

Access Gmail with Indy

Posted on 2007-11-18
6
Medium Priority
?
2,159 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 17

Accepted Solution

by:
TheRealLoki earned 200 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 120 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
Cloud Training Guides

FREE GUIDES: In-depth and hand-crafted Linux, AWS, OpenStack, DevOps, Azure, and Cloud training guides created by Linux Academy instructors and the community.

 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month13 days, 15 hours left to enroll

800 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