用javamail发信,提示如下错误,为什么? smtp.sina.com.cn???什么意思?协议和服务器混为一谈?!!!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 telnet smtp.sina.com.cn 25ehlo或helo看看该服务器支持什么样的东东 看了,是下面这些,什么意思啊?250-sina.com250-AUTH=LOGIN250-AUTH LOGIN250-PIPELINING250 8BITMIME250 sina.com Properties props = System.getProperties(); props.put("mail.host", host); props.put("mail.transport.protocol", "smtp"); Properties properties = System.getProperties(); properties.put("mail.smtp.host","smtp.sina.com.cn"); properties.put("mail.transport.protocol", "smtp"); properties.put("mail.smtp.auth","true"); Session session = Session.getInstance(properties, new Authenticator() { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication("myusername","mypassword"); } }); try { MimeMessage message = new MimeMessage(session); message.setFrom(new InternetAddress(strFrom)); InternetAddress[] toadd = InternetAddress.parse(strEmail); message.setRecipients(Message.RecipientType.TO,toadd); message.setSubject(strSubject); message.setText(strFullMailText); Transport transport = session.getTransport(); message.saveChanges(); transport.send(message,message.getAllRecipients()); transport.close(); } catch (AddressException e) { System.out.println("There was an error parsing the addresses."); System.out.println(e.getMessage()); } catch (SendFailedException e) { System.out.println("There was an error sending the message."); System.out.println(e.getMessage()); } catch (MessagingException e) { System.out.println("There was an unexpected eorror."); System.out.println(e); }楼上的,这是我的程序,照你的方法改了,好了什么错误都不提示了可就是没有收到信,见鬼了 如果你用的TOMCAT。你可以看看tomcat代的例子。能简单 finallize方法是什么,在哪里?? 100分求得<精通J2EE--Eclipse、Struts、Hibernate及Spring整合应用案例>源码和数据库 java中注释的问题 applet小应用程序怎样才能运行 表格问题!!!!急 请教:关于awt中关闭当前dialog的问题 怎样快速生成一个指定大小的文件? 求帮忙找出空指针变量值 怎样将数据库的空格和换行符显示出来? FlowLayout()是什么意思 关于super 如何 在两个窗口传递动态的 参数!!
250-sina.com
250-AUTH=LOGIN
250-AUTH LOGIN
250-PIPELINING
250 8BITMIME
250 sina.com
props.put("mail.host", host);
props.put("mail.transport.protocol", "smtp");
properties.put("mail.smtp.host","smtp.sina.com.cn");
properties.put("mail.transport.protocol", "smtp");
properties.put("mail.smtp.auth","true");
Session session = Session.getInstance(properties,
new Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication("myusername","mypassword");
}
}); try
{
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress(strFrom)); InternetAddress[] toadd = InternetAddress.parse(strEmail);
message.setRecipients(Message.RecipientType.TO,toadd); message.setSubject(strSubject);
message.setText(strFullMailText); Transport transport = session.getTransport();
message.saveChanges();
transport.send(message,message.getAllRecipients());
transport.close(); }
catch (AddressException e)
{
System.out.println("There was an error parsing the addresses.");
System.out.println(e.getMessage());
}
catch (SendFailedException e)
{
System.out.println("There was an error sending the message.");
System.out.println(e.getMessage());
}
catch (MessagingException e)
{
System.out.println("There was an unexpected eorror.");
System.out.println(e);
}
楼上的,这是我的程序,照你的方法改了,好了
什么错误都不提示了
可就是没有收到信,见鬼了