当前位置:编程学习 > JSP >>

简单的收信的例子:SimpleReceiver

import javax.mail.*;
import javax.mail.internet.*;
import java.util.*;
import java.io.*;
/**
* A 易做图 email receiver class.
*/
public class SimpleReceiver{
/**
 * Main method to receive messages from the mail server specified
 * as command line arguments.
 */
    public static void main(String args[]){
        try{
            String popServer=args[0];
            String popUser=args[1];
            String popPassword=args[2];
            receive(popServer, popUser, popPassword);
        }catch (Exception ex){
            System.out.println("Usage: java com.lotontech.mail.SimpleReceiver"+" popServer popUser popPassword");
        }
        System.exit(0);
    }
    /**
    * "receive" method to fetch messages and process them.
    */
    public static void receive(String popServer, String popUser, String popPassword){
        Store store=null;
        Folder folder=null;
        try{
            // -- Get hold of the default session --
            Properties props = System.getProperties();
补充:Jsp教程,邮件
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,