你这个smtp地址需要认证,而你写的程序里没写
解决方案 »
- 死循环往一个表插入数据
- 如何把java程序部署到服务器电脑上
- hibernate: table is not mapped. 急,在线等!
- 关于uploadpicture 图片上传组件的使用
- 各位有没有看过hibernet 源码的呀?
- ibatis参数设置的问题,困扰了很长时间了
- struts!!!options 问题!!!
- 有人遇到 页面刚过大&用enctype="multipart/form-data"提交n个附件,到ActionForm中Setter就终止 情况吗?
- EJB中的NextID的问题
- 新人求教,关于SqlHelper静态资源
- 从数据库拿出的jsp页可以直接用excel显示吗!求教!高手出来啊!100分。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
- 请问大家这是什么错误:[SQLServer JDBC Driver]Connection reset by peer: socket write error?
msg.setUserName("。");
msg.setPassword("。");
class Authentic
extends Authenticator { //验证密码 public Authentic() {
} public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}Session session = Session.getInstance(getProperties(), new Authentic()); private Properties getProperties() {
Properties rs = new Properties();
rs.put("mail.smtp.host", server);
rs.put("mail.smtp.port", port);
rs.put("mail.smtp.auth", validate ? "true" : "false");
return rs;
}
麻烦也给我发一份吧!我和楼主的问题一样的!
[email protected]
[email protected]
BodyPart mdp = new MimeBodyPart();
mdp.setContent(cctext,"text/html;charset=gb2312");
Multipart mm= new MimeMultipart();
mm.addBodyPart(mdp);
newMessage.setContent(mm);newMessage.saveChanges();transport = sendMailSession.getTransport("smtp");
transport.connect("smtp.163.com","id","pass");
transport.sendMessage(newMessage,newMessage.getAllRecipients());
transport.close();
帅哥我用了你的代码怎么出错啊。出程序的错。。代码的错啊!fantasyCoder(JC★牛仔)
你的代码放在JSP中也是出错了。。代码的错误。。你们能给一个完整的代码给我吗?[email protected]
好心人也给我发一份吧