我们用javamail实现
看代码
import javax.mail.*;
import javax.mail.internet.*;
import java.util.*;
import java.io.*;
public class POPMail2
{
public static void main(String args[])
{
try{
String popServer="pop3.sohu.com";//邮箱服务器,可自己更改
String popUser="********";//***是代表你邮箱的帐号
String popPassword="***";//你邮箱的密码
receive(popServer,popUser,popPassword);
}
catch(Exception e){
System.out.println(e);
}
System.exit(0);
}
public static void receive(String popServer,String popUser,String popPassword)
{
Store store=null;
Folder folder=null;
try{
//get session
Properties props=System.getProperties();
Session session=Session