如何导入javax.mail.session?
我正在尝试使用 java 连接 SMTP。 我已在程序中包含 mail.jar,但无法导入 javamail.session。
请给我一些想法来获取它。
提前致谢
I am trying to connect SMTP using java.
I have included mail.jar in my program but I am not able to import javamail.session.
plz give me some idea hw to get it .
thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“包含在我的计划中”可以有多种解释。您需要将邮件 jar 放在您的 类路径 当你编译程序和运行程序时。提供一些更详细的信息、错误信息等,我们可以给您更好的答复。
"Included in my program" can be interpreted many ways. You need to have the mail jar on your classpath both when you compile the program and when you run it. Provide some more detail, error messages, etc., and we can give you a better answer.
您不能只是创建新的会话...而是您需要:
除此之外,您可能想要一一导入(而不是所有类),这可能指向丢失的类、路径、jar...
You can not just create new Session... but rather you will need to:
Besides that you might want to import one by one (rather then all classes) and that might point to the missing class, path, jar...