public ReceiveMail(JFrame jFreame)
{
this.jFrame=jFrame;
}
public void receive(String server,String user,String psd)
{
Store store=null;
Folder folder=null;
try
{
Properties properties=System.getProperties();
Session session=Session.getDefaultInstance(properties,null);
store=session.getStore( "pop3 ");
store.connect(server, user, psd);
folder=store.getDefaultFolder();
if(folder==null)
throw new Exception( "No default folder ");
folder=folder.getFolder( "INBOX ");
if(folder==null)
throw new Exception( "No pop3 InBox ");
folder.open(Folder.READ_ONLY);
Message[] msgs=folder.getMessages();
}
catch(Exception e)
{
if (dialog == null)
dialog = new AboutDialog(jFrame,e.getMessage());
dialog.setVisible(true);
e.printStackTrace();
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~上面是我的代码
javax.mail.AuthenticationFailedException: ??·¨????????????/?????????í?ó????·????????ì?é??·????? - authorization failed
at com.sun.mail.pop3.POP3Store.protocolConnect
这个是异常~~
问题在什么地方啊?
------解决方案--------------------
你换成163的邮箱试下,看着没什么问题啊,在store.connect(server, user, psd);上下打印一下看看