Java Mail : No provider for smtp

前端 未结 6 862
太阳男子
太阳男子 2020-12-06 11:57

I am using JavaMail to do a simple application that sends an email when it finds some files in a directory. I managed to get it worked from Eclipse. I Run the application an

相关标签:
6条回答
  • 2020-12-06 12:08

    The supporting jars: mail.jar and activation.jar are not on your classpath. When you build your jar, you need to include these on your classpath.

    0 讨论(0)
  • 2020-12-06 12:14

    I had the same error, updating the jar from Oracle directly fixed it.

    0 讨论(0)
  • 2020-12-06 12:18

    I had the same problem.

    You can fix it by making the Runnable JAR file in Eclipse and using library handling options. Select the second one when making your JAR, the one that says "Package required libraries into generated JAR".

    0 讨论(0)
  • 2020-12-06 12:23

    you need to add the smtp.jar file, I also got stuck with the same error after some google search and checking on some older projects I found that I missed this particular jar in my library, I added this jar to the library and found issue fixed.

    0 讨论(0)
  • 2020-12-06 12:29

    For those using Gradle: you can get all required Jars as follows (1.5.5 is the latest version):

        compile 'com.sun.mail:javax.mail:1.5.5'
    
    0 讨论(0)
  • 2020-12-06 12:29

    I managed to fix this error, which was due to a bad library. I tried to use javax.mail jar downloaded from maven, which turned out to be incomplete. So I searched once more for javamail and got one directly from Oracle (click Release link). This time it is a zip file.

    0 讨论(0)
提交回复
热议问题