MyException - 我的异常网
当前位置:我的异常网» Java Web开发 » 怎样得到未读邮件的个数!小弟我只要得到未读邮件的

怎样得到未读邮件的个数!小弟我只要得到未读邮件的个数就行了!如何弄(4)

www.MyException.Cn  网友分享于:2013-01-25  浏览:53次

        System.out.println( "This   is   a   Nested   Message ");
        System.out.println( "--------------------------- ");
        dumpPart((Part)o);
}   else   if   (o   instanceof   InputStream)   {
        System.out.println( "This   is   just   an   input   stream ");
        System.out.println( "--------------------------- ");
        InputStream   is   =   (InputStream)o;
        int   c;
        while   ((c   =   is.read())   !=   -1)
System.out.write(c);
}
        }

        public   static   void   dumpEnvelope(Message   m)   throws   Exception   {
System.out.println( "This   is   the   message   envelope ");
System.out.println( "--------------------------- ");
Address[]   a;
//   FROM  
if   ((a   =   m.getFrom())   !=   null)   {
        for   (int   j   =   0;   j   <   a.length;   j++)
System.out.println( "FROM:   "   +   a[j].toString());
}

//   TO
if   ((a   =   m.getRecipients(Message.RecipientType.TO))   !=   null)   {
        for   (int   j   =   0;   j   <   a.length;   j++)
System.out.println( "TO:   "   +   a[j].toString());
}

//   SUBJECT
System.out.println( "SUBJECT:   "   +   m.getSubject());

//   DATE
Date   d   =   m.getSentDate();
System.out.println( "SendDate:   "   +
        (d   !=   null   ?   d.toString()   :   "UNKNOWN "));

//   SIZE
System.out.println( "Size:   "   +   m.getSize());

//   FLAGS:
Flags   flags   =   m.getFlags();
StringBuffer   sb   =   new   StringBuffer();
Flags.Flag[]   sf   =   flags.getSystemFlags();   //   get   the   system   flags

boolean   first   =   true;
for   (int   i   =   0;   i   <   sf.length;   i++)   {
        String   s;
        Flags.Flag   f   =   sf[i];
        if   (f   ==   Flags.Flag.ANSWERED)
s   =   "\\Answered ";
        else   if   (f   ==   Flags.Flag.DELETED)
s   =   "\\Deleted ";
        else   if   (f   ==   Flags.Flag.DRAFT)
s   =   "\\Draft ";
        else   if   (f   ==   Flags.Flag.FLAGGED)
s   =   "\\Flagged ";
        else   if   (f   ==   Flags.Flag.RECENT)
s   =   "\\Recent ";
        else   if   (f   ==   Flags.Flag.SEEN)
s   =   "\\Seen ";
        else