使用javaxmail从Gmail服务器检索邮件时出错

时间:2015-05-08 14:49:27

标签: javax.mail

此代码用于从gmail服务器检索邮件,它仅工作一分钟然后停止原因?

ActionListener displayNotification = new ActionListener() {
 int oldn=0, newn=0;Folder f = s.getmailFolder();
  public void actionPerformed(ActionEvent ae) {     
      try{
      f=s.getmailFolder();
      newn=f.getUnreadMessageCount();

      }catch(Exception e){}
      if (oldn!=newn)
       s.getNotification(f);
      oldn=newn;
  }
};
 Timer t = new Timer (10000,displayNotification);
 t.start();

0 个答案:

没有答案