真的很烦 不知道什么错误! String host = "pop.263.net"; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 263服务器的IP(既263.net)不是指向邮件服务器的,你要找到pop.263.net的IP就可以了,我提供一个202.96.44.24。将String host = "263.net";改为String host = "202.96.44.24";我的得分很少的,好了后记得给分哦 :) 为了这分,编了一个发的看看:package com.juan.mail;import javax.mail.*;import javax.mail.internet.*;import javax.activation.*;import java.util.*;/** * Insert the type's description here. * Creation date: (2002-3-19 10:30:42) * @author: Tiger */public class Test { /** * Constructor for Test. */ public Test() { super(); } public static void main(String[] args) { try { Properties props = new Properties(); Session sendMailSession; Store store; Transport transport; sendMailSession = Session.getInstance(props, null); props.put("mail.smtp.host", "202.108.255.203"); props.put("mail.smtp.auth", "true"); Message newMessage = new MimeMessage(sendMailSession); newMessage.setFrom(new InternetAddress("[email protected]")); newMessage.setRecipient( Message.RecipientType.TO, new InternetAddress("[email protected]")); newMessage.setSubject("subject1"); newMessage.setSentDate(new Date()); newMessage.setText("text"); transport = sendMailSession.getTransport("smtp"); newMessage.saveChanges(); transport.connect("202.108.255.203", "user", "password"); transport.sendMessage( newMessage, newMessage.getRecipients(Message.RecipientType.TO)); transport.close(); } catch (SendFailedException e) { System.out.println(e.toString()); } catch (MessagingException m) { System.out.println(m.toString()); } }} 偶真的要晕了!我是问发的为了表示诚意 帮我解决这个问题的同志 我将将此贴的100分加上http://www.csdn.net/Expert/TopicView1.asp?id=587830的一百分 一起奉送!只求大家能帮我看看为什么 你的程序没问题,可能是你用的包有问题,感到很奇怪,你明明用的是javax的那个包,为啥会出现sun那个包的错误???? 那你的建议是什么?我有去下了javamail1.13加上了 也不行 没仔细看过JavaMail,不过API说你这个是由于这个message已经被删掉了,所以用getFrom方法会出现这个错误。觉得你应该先检查isExpunged()标志,如果是true,就不能显示了。 嗨!你的程序没错误,一切正常。我建议你不要把程序放在桌面,JAVA处理中文目录好象不是很好。再试一试。 呵呵 真是大faint!原来真的是信件出问题了!jimjxr(宝宝猫)谢谢了!马上给你加上分请到http://www.csdn.net/Expert/TopicView1.asp?id=587830还有100分赠送 呵呵 单点登录(用户统一认证 )Java 调用父类的变量和方法 很简单的报错却改不了,等着明天交 DDA画直线算法的作业的,希望今晚有人能替我解决 正则表达式高手来帮忙! jdbc与存储过程问题 关与JDK的问题 问大家一个问题[参加有分] 刚入门者的上机题,在异常方面有些问题,请大家指教 request.getParameterName().hasMoreElement()是什么意思? 我想在JAVA中调用VC++的东西,怎么做?当然,这个系统只能在WINDOWS跑。 关于repaint()的一个问题??? 编译完成的.class怎么才能运行呀?
改为
String host = "202.96.44.24";
我的得分很少的,好了后记得给分哦 :)
import javax.mail.internet.*;
import javax.activation.*;
import java.util.*;
/**
* Insert the type's description here.
* Creation date: (2002-3-19 10:30:42)
* @author: Tiger
*/
public class Test { /**
* Constructor for Test.
*/
public Test() {
super();
} public static void main(String[] args) {
try {
Properties props = new Properties();
Session sendMailSession;
Store store;
Transport transport;
sendMailSession = Session.getInstance(props, null);
props.put("mail.smtp.host", "202.108.255.203");
props.put("mail.smtp.auth", "true");
Message newMessage = new MimeMessage(sendMailSession);
newMessage.setFrom(new InternetAddress("[email protected]"));
newMessage.setRecipient(
Message.RecipientType.TO,
new InternetAddress("[email protected]"));
newMessage.setSubject("subject1");
newMessage.setSentDate(new Date());
newMessage.setText("text");
transport = sendMailSession.getTransport("smtp");
newMessage.saveChanges();
transport.connect("202.108.255.203", "user", "password");
transport.sendMessage(
newMessage,
newMessage.getRecipients(Message.RecipientType.TO));
transport.close();
} catch (SendFailedException e) {
System.out.println(e.toString());
} catch (MessagingException m) {
System.out.println(m.toString());
}
}
}
我是问发的
为了表示诚意
帮我解决这个问题的同志
我将将此贴的100分加上
http://www.csdn.net/Expert/TopicView1.asp?id=587830
的一百分 一起奉送!
只求大家能帮我看看为什么
你的程序没错误,一切正常。我建议你不要把程序放在桌面,JAVA处理中文目录好象不是很好。再试一试。
真是大faint!
原来真的是信件出问题了!
jimjxr(宝宝猫)谢谢了!
马上给你加上分
请到http://www.csdn.net/Expert/TopicView1.asp?id=587830
还有100分赠送 呵呵