Imap class implementes IMAP client API
Inheritance: ImapBase
Exemplo n.º 1
0
 public MyImapWrapper(string imapHost, ushort imapPort, string imapUser, string imapPassword)
 {
     _imapContext = new Imap();
     try
     {
         _imapContext.Login(imapHost, imapPort, imapUser, imapPassword, true);
     }
     catch (Exception)
     {
         //TODO: Implement login exception
         throw;
     }
 }
		public override Boolean Check ()
		{
			Imap imap = new Imap();
			imap.Login(ServerAddress, Email, Password);

			imap.ExamineFolder("Inbox");

			ArrayList messages = new ArrayList();
			imap.SearchMessage(new string[] { "UNSEEN" }, true, messages);

			for (int i = messages.Count - 1; i >= 0; i--)
			{
				if ((string)messages[i] == "")
					messages.RemoveAt(i);
			}

			return messages.Count > 0;
		}