props.put("mail.smtp.auth",  "true");加上它就要求认证了,你在连接的时候必须给出用户名和密码

解决方案 »

  1.   

    Properties properties = System.getProperties();
                properties.put("mail.smtp.host",smtp.sina.com);
                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(strUserName,strPassword);
                    }
                });
                        try
                        {
                            MimeMessage message = new MimeMessage(session);
                            message.setFrom(new InternetAddress(strMail));
                            InternetAddress[] toadd = InternetAddress.parse(strEmailTo);
                            message.setRecipients(Message.RecipientType.TO,toadd);
                            
                            Transport transport = session.getTransport();
                            message.saveChanges();
                            transport.send(message,message.getAllRecipients());
                            transport.close();                    }
                        catch (AddressException e)
                        {
                        }
                        catch (SendFailedException e)
                        {
                        }
                        catch (MessagingException e)
                        {
                        }
      

  2.   

    找点javamail方面的资料看看吧