示例#1
0
        public Boolean ServerExists(IMAPServer server)
        {
            var retryAttempt = 0;
            var connectedSuccessfully = false;

            while ((retryAttempt < MAXRETRY) 
                       && (!connectedSuccessfully))
            {
                try
                {
                    using (ImapClient client = server.GetClient())
                    {
                        connectedSuccessfully = true;
                    }
                    retryAttempt++;
                }
                catch (Exception exception)
                {
                    connectedSuccessfully = false;
                    server.Exception = exception;
                }
            }
            server.ConnectedSuccessfully = connectedSuccessfully;
            return connectedSuccessfully;
        }
 public EmailCommandArgs(String emailAddress, String emailPassword, String hostName, Int32 port, Boolean sslMode)
 {
     EmailAddress = emailAddress;
     EmailPassword = emailPassword;
     IMAPServer = new IMAPServer(emailAddress,emailPassword,hostName,port,sslMode);
 }