?? jfmlistingheaders.java
字號:
/* * Created on 2004.08.25 * JFreeMail - Java mail component * Copyright (C) 2004 Dalibor Krleza * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package org.jfreemail.demo;import org.jfreemail.pop3.*;import org.jfreemail.core.*;/** * Demo which shows how to download headers and show thier basic * data. */public class JfmListingHeaders { public static void main(String[] args) { try { /* * We are making pop object. Immediate authentication. If not * thrown exception, object is ready for use. */ JfmPOP3 pop=new JfmPOP3("pop.server.domain",0, JfmConsts.POP3_APOP,"dalibor","secret111"); /* * Download all headers. */ JfmEmailHeader[] email_headers=pop.getMailboxHeaders(); for(int i=0;i<email_headers.length;i++) { /* * Iterate through header list and print important data. */ System.out.println("E-mail number:"+String.valueOf(i)); System.out.println("Sender:"+email_headers[i].getFrom()); System.out.println("Receiver:"+email_headers[i].getTo(0)); System.out.println("Subject:"+email_headers[i].getSubject()); } /* * Close connection to POP3 server. */ pop.close(); } catch(Exception exc) { System.out.println(exc.getMessage()); } }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -