Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a mail server and trying to connect to it using pop3 from console application.
but getting exception .. no Such host found.
when i Hit the mail server url manually and login , i am able to login successfully.
please advice.

What I have tried:

using (Pop3 pop3 = new Pop3())
           {
               try
               {
                   pop3.Connect("mail.cloud.xyz.com");  // or ConnectSSL for SSL
                   pop3.UseBestLogin("mailadmin@cloud.xyz.com", "XYZ");
               }
               catch (Exception ex)
               {
                   var mss = ex;
               }// or

           }
Posted
Updated 16-Apr-18 0:00am
Comments
F-ES Sitecore 16-Apr-18 5:43am    
The error is pretty clear, there is probably some network issue preventing the server from resolving the host name. Contact whoever administers the IIS server, or see if using the IP address rather than the host name works.
ashu1810 16-Apr-18 6:27am    
Thank you for the reply.. I tried with IP address too but its not working.

1 solution

"No such host found" means that the server name could not be resolved (the corresponding IP address could not be determined) by any of the name lookup methods (DNS, hosts file).

The most common reason is a typo. So check your server name or use copy & paste. To check name resolving you can open a command prompt window and use
nslookup mail.cloud.xyz.com

If it still does not work it might be a problem of the used library. If that is the commercial LimiLabs library (which seems to be case according to the posted code), you might ask at their forum: Limilabs Q&A[^].
 
Share this answer
 
Comments
ashu1810 16-Apr-18 6:32am    
Thank you for reply.. checked with the command prompt,able to see the server details. I think its the problem with the Limilabs library.
Jochen Arndt 16-Apr-18 6:56am    
That is the drawback of such closed source libraries: You can't check what is does.

I did not even found a documentation about the provided methods with a quick web research. If there is an overload for the Connect() method accepting an IP address (as string or IPAddress class), you can try that using the address from the nslookup output.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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