smtp.sina.com.cn???什么意思?
协议和服务器混为一谈?!!!!!

解决方案 »

  1.   

    telnet smtp.sina.com.cn 25ehlo或helo看看该服务器支持什么样的东东
      

  2.   

    看了,是下面这些,什么意思啊?
    250-sina.com
    250-AUTH=LOGIN
    250-AUTH LOGIN
    250-PIPELINING
    250 8BITMIME
    250 sina.com
      

  3.   

    Properties props = System.getProperties();
            props.put("mail.host", host);
            props.put("mail.transport.protocol", "smtp");
      

  4.   

    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);
                        }
    楼上的,这是我的程序,照你的方法改了,好了
    什么错误都不提示了
    可就是没有收到信,见鬼了
      

  5.   

    如果你用的TOMCAT。你可以看看tomcat代的例子。能简单