locked
How to import mail messages from exchange server 2003 in c# RRS feed

  • Question

  • User1545643680 posted

    Hello All,

    Subject as a question..

    I am using "Jscape.Email.dll" to retrive emails from the server.

     String lsLicenseKey = "My LicenseKey";
            Imap imp = new Imap("192.168.1.10", msUserName, msPassword);
            imp.LicenseKey = lsLicenseKey;
            try
            {
                imp.Connect();
                if (imp.GetMessageCount() > 0)
                {
                    Response.Write(imp.GetMessageCount());
                }
            }
            catch (System.Exception ex)
            {
                throw new System.Exception(ex.Message);
            }
            finally
            {
                // Disconnect from the server.
                imp.Disconnect();
            }

    I am getting this error.

    System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
      at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
      at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
      at Jscape.Email.Imap.Connect()


    Thanks in advance

    Tuesday, February 23, 2010 4:06 AM

Answers

  • User1545643680 posted

    Hello,

    I have resolved this issue .Its a port problem.

    I have set imp.Port value.


    Thanks


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, February 23, 2010 8:29 AM