想用Java api发送邮件,导入相关的包:import javax.mail.*;
import javax.mail.*;
然后Eclipse就报错如下错误:
The import javax.mail cannot be resolved
看别人写的代码里也没用专门引入javax.mail相关的包啊,求大神赐教....
需要先下載對應的jar包,然後在eclipse裡面「build path-> configure build path-> add external jar」
給個下載網址:http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-eeplat-419426.html#javamail-1.4.5-oth-JPR#🎜 🎜#
推薦使用commons-Email,这个Jar包到處都是
commons-Email
Jar
1.別人肯定有用的,可能在你看到的類別的父類當中,已經引入了那些類別。 2.你引入的,它報錯,是由於沒有編譯,原因就是,需要你,設定一下這個:「build path-> configure build path-> add external jar」3.Eclipse經常抽筋,導入jar包,重新編譯項目,refresh一下整個項目,就好了。
需要先下載對應的jar包,然後在eclipse裡面「build path-> configure build path-> add external jar」
給個下載網址:http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-eeplat-419426.html#javamail-1.4.5-oth-JPR#🎜 🎜#
推薦使用
commons-Email
,这个Jar
包到處都是1.別人肯定有用的,可能在你看到的類別的父類當中,已經引入了那些類別。
2.你引入的,它報錯,是由於沒有編譯,原因就是,需要你,設定一下這個:
「build path-> configure build path-> add external jar」
3.Eclipse經常抽筋,導入jar包,重新編譯項目,refresh一下整個項目,就好了。