Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/SharedByteArrayInputStream
        at Email1.<init>(Email1.java:44)
        at Email1.main(Email1.java:8)
应如何改才能正确,为什么?

解决方案 »

  1.   

    I change your mailhost to mine and code to
       //设置邮件主题
            mimeMsg.setSubject(subject);        //设置邮件内容
            mimeMsg.setText( content  );I got email sent by your code. Everything is fine.
      

  2.   

    在网上找找 有现成的例子 缺了一个authorized
      

  3.   

    I change your mailhost to mine and code to
       //设置邮件主题
            mimeMsg.setSubject(subject); // NO "GBK"        //设置邮件内容
            mimeMsg.setText( content  ); // NO "GBK"I got email sent by your code. Everything is fine.Maybe some setting in ur machine are not right.