怎样用java编程通过SMTP服务器的认证? 这不是SOCKET编程的问题,你需要研究的是SMTP协议吧 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 import javax.mail.*;public class EmailAuthenticator extends Authenticator { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication ("user","password" ); } }/////Properties sessionProp=new Properties();//设置认证sessionProp.setAttibute("mail.smtp.auth","true");mailSession=Session.getDefaultInstance(sessionProp,new EmailAuthenticator());可以用javamail搜索到这些资料。 求助,hibernate不知道什么原因,出现了这个错误 一个程序员的困惑 如何用JAVA代码实现C语言程序编译 刚进一小公司实习,一些问题要求助。 兄弟们,俺要找工作了,想找几份java软件题做做,谢谢! struts1如何动态增加删除文本框,并在后台获取数据写如数据库呢? eclipse中打包发布的命令在哪里? 请问各位大虾一个用eclipse+lomboz+jboss开发ejb的问题?? 用sax解析xml的问题 大哥,大姐,帮帮忙,小弟先谢谢了! 一个EJB例子运行出错,100分请教!一定给分! JBUILDER中,生成了一个EJB,该怎么运行?
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication ("user","password" );
}
}
/////
Properties sessionProp=new Properties();
//设置认证
sessionProp.setAttibute("mail.smtp.auth","true");mailSession=Session.getDefaultInstance(sessionProp,new EmailAuthenticator());
可以用javamail搜索到这些资料。