Beispiel #1
0
 public MailChecker(ImapClient imap)
 {
     if (imap.Connect())
     {
         if (imap.HostName.Contains("yahoo")) 
         {//Yahooメール処理
             if (imap.GetMailBox() != null)
             {
                 type = MAIL_TYPE.YMAIL;
                 mailCnt = yMailCntGet(imap.GetMailBox());
             }
             else MessageBox.Show("メールが存在しませぬ");
         }
         else
         {//GMail処理
             if (imap.GetMailList() != null)
             {
                 type = MAIL_TYPE.GMAIL;
                 mailCnt = imap.GetMailList().Count();
             }
             else MessageBox.Show("メールが存在しませぬ");
         }
     } else MessageBox.Show("失敗");
 }
Beispiel #2
0
        public void checkImap(ImapClient imap,TaskbarIcon icon)
        {
            if (imap.Connect())
            {
                int getMailCnt;
                if (type == MAIL_TYPE.GMAIL) getMailCnt = imap.GetMailList().Count();
                else getMailCnt = yMailCntGet(imap.GetMailBox());

                if (getMailCnt != mailCnt)
                {
                    if (getMailCnt > mailCnt)
                    {
                        int newCnt = getMailCnt - mailCnt;
                        icon.ShowBalloonTip("メールの通知", "新着メール " + newCnt + "件", BalloonIcon.Info);

                    }
                    mailCnt = getMailCnt;
                }
                //string msg = "getMailCnt:" + getMailCnt + "件\nmailCnt:" + mailCnt;
                //icon.ShowBalloonTip("メールの通知", msg, BalloonIcon.Info);
            }
            
        }