不知道你说的是什么意思。写的详细一点。

解决方案 »

  1.   

    .....
     Properties props = new Properties();
    //增加一个验证的类。
        props.put("mail.smtp.host", smtpHost);
        props.put("mail.smtp.auth",mailSmtpAuth);
        Authenticator auth = new MyAuthenticator(user,password);
        Session session = Session.getDefaultInstance(props, auth);
    ....public MyAuthenticator(String user,String passwd){
          username=user;
          password=passwd;
      }