Properties p = System.getProperties();
      p.put("mail.smtp.host", this.smtp);
      p.put("mail.smtp.auth", "true"); //设置为须验证的模式
      Session session = Session.getDefaultInstance(p, new Email_ca("user", "password"));
      MimeMessage msg = new MimeMessage(session);
      msg.setSentDate(new Date());
      InternetAddress from = new InternetAddress(frommail);
      msg.setFrom(from);
      InternetAddress[] address =
          {
          new InternetAddress(tomail)};
      msg.setRecipients(Message.RecipientType.TO, address);
      msg.setSubject(this.subject);
      msg.setText(this.content);
      Transport.send(msg);
      return true;以上改设的都设好了! 但是运行时输出以下信息:
Could not connect to SMTP host: smtp.163.com, port: 25;
  nested exception is:
java.net.SocketException: Software caused connection abort: connect
请问高手是怎么回事! smtp.163.com 是开着的!

解决方案 »

  1.   

    Transport在发送之前需要连接的,而且需要指定是smtp
      

  2.   

    1.确认一下是否服务器或者路由器的杀毒软件或者设置阻止了你的邮件发送.
    2.试试telnet smtp.163.com  25
      

  3.   

    服务器是否允许你连接?
    http://www.donews.net/redtroy/archive/2005/07/06/456210.aspx
      

  4.   

    p.put("mail.smtp.host","SMTP.163.COM");
    试试看