Click here to Skip to main content
14,933,981 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am trying to access mail from gmail server, but when I try to connect it gives me error:

Unable to read data from transport connection: connection attempt failed because the connected party did not properly respond after a period of time, or establish connection failed because connected host has failed to respond.


When I am running same application on my development PC it works perfectly, but when install setup on client PC it gives error

if (pop3Client.Connected)
                   pop3Client.Disconnect();
               pop3Client.Connect(popServerTextBox.Text, int.Parse(portTextBox.Text), useSslCheckBox.Checked);
               //pop3Client.Connect("pop.gmail.com", 995, null, Pop3Cli);

               pop3Client.Authenticate(loginTextBox.Text, passwordTextBox.Text,AuthenticationMethod.UsernameAndPassword);
               //pop3Client.Authenticate(loginTextBox.Text, passwordTextBox.Text);



But giving same error all along.
Please help , I am stuck.

Thanks

What I have tried:

I tried disabling anti-virus and firewall but same error.
I tried using port 587 but gave "Handshake error"
I have enabled "Enabled POP for all Mail" , and also turned On Allow less secured apps
Posted
Updated 20-Jul-18 2:47am

This is a configuration or other settings issue at that PC and you will need to do some debugging to find out what is happening. in the meantime you can check Read Gmail messages on other email clients using POP - Gmail Help[^], and also try manually connecting through a command window on the new PC.
   
Quote:
When I am running same application on my development PC it works perfectly, but when install setup on client PC it gives error
That indicates that it is a problem with the client system or it's local network environment.

Quote:
I tried disabling anti-virus and firewall but same error.
Disabling is a bad choice. All you have to check is if outgoing packets to port 995 are blocked. But this must be not only done for the system itself but also for the router that connects the system to the net. These routers have their own firewall and routing rules. Some have for example options to allow mail services only for specific domains.

From your description this is the most probable source of your problem: The request is blocked by the router. If the client system is part of larger network (like a company or instution), check if they have a network administrator. If so, contact him.

Quote:
I tried using port 587 but gave "Handshake error"
Port 587 is SMTP with TLS/STARTTLS. That is a different protocol so that you get an error. But it tells you that you got at least a connection.

Quote:
I have enabled "Enabled POP for all Mail" , and also turned On Allow less secured apps
That does not matter while you get no connection. It is necessary to successfully login and use POP3 with Gamil.
   
Comments
markwhite1 20-Jul-18 8:54am
   
Even I thought ts something to do with the client PC settings. Client PC is not a big company , its a restaurant and PC gets wifi from router, I can access router if any changes required.
Jochen Arndt 20-Jul-18 9:01am
   
Then check the router settings (optionally read the manual first). I still guess that port 995 is blocked there (using POP3 is rather uncommon nowadays) while port 587 is allowed. If the router provides a log (common and accessible by the web interface) it might also contain entries about blocked packets.
markwhite1 20-Jul-18 9:04am
   
How can I check port settings in router, I can go to its page, but where do I look ?
Jochen Arndt 20-Jul-18 9:10am
   
If you did not find the setting in the router's web interface you have to consult the manual.
markwhite1 20-Jul-18 9:11am
   
Ok , let my client come to the Pc will ask him the router details and update you
markwhite1 23-Jul-18 13:35pm
   
Hi, I have setup port opening on router, but still same issue. However, client has another pc connected to WIFI using same router and application worked perfectly. So any suggestions?
Jochen Arndt 23-Jul-18 15:38pm
   
Not really. But it is then clearly on that specific system. Ask the owner if he has some other "security" software installed.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900