javamail | JavaMail API Reference Implementation | REST library

 by   javaee Java Version: JAVAMAIL-1_6_2 License: Non-SPDX

kandi X-RAY | javamail Summary

kandi X-RAY | javamail Summary

javamail is a Java library typically used in Web Services, REST applications. javamail has no bugs, it has no vulnerabilities, it has build file available and it has high support. However javamail has a Non-SPDX License. You can download it from GitHub, Maven.

See the JavaMail web site.

            kandi-support Support

              javamail has a highly active ecosystem.
              It has 504 star(s) with 201 fork(s). There are 54 watchers for this library.
              It had no major release in the last 12 months.
              javamail has no issues reported. There are no pull requests.
              It has a positive sentiment in the developer community.
              The latest version of javamail is JAVAMAIL-1_6_2

            kandi-Quality Quality

              javamail has 0 bugs and 0 code smells.

            kandi-Security Security

              javamail has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              javamail code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              javamail has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              javamail releases are available to install and integrate.
              Deployable package is available in Maven.
              Build file is available. You can build the component from source.

            Top functions reviewed by kandi - BETA

            kandi has reviewed javamail and discovered the below as its top functions. This is intended to give you an instant insight into javamail implemented functionality, and help decide if they suit your requirements.
            • Recursively expand the list of addresses .
            • Perform an OR operation .
            • Main entry point .
            • Verify verify settings .
            • send a message to the given addresses
            • Internal method used to encode a string .
            • Parse the specified mailcap entry .
            • Checks that the given address is valid .
            • Set the Multipart data source .
            • Create socket .
            Get all kandi verified functions for this library.

            javamail Key Features

            No Key Features are available at this moment for javamail.

            javamail Examples and Code Snippets

            No Code Snippets are available at this moment for javamail.

            Community Discussions


            JavaMail and Oauth2: Exception "Can't send command to SMTP host" / "SSLHandshakeException: No appropriate protocol"
            Asked 2022-Mar-25 at 07:19

            I get the following exception when trying to send a mail with JavaMail with OAuth2:



            Answered 2022-Mar-25 at 07:19

            I found the solution myself. Maybe somone can make use of it:

            The code above was not false to my knowledge. The actual reason was, that I should not have used a token acquisition with client credentials but only with username/password and client id.

            I am not sure if JavaMail supports this because in the documentation I could not find anything about it. The rare examples about this are usually with client credentials.

            As you can see above, no AUTH command was triggered because I had not the permission to do it obviously.

            What I needed to do aswell was to use the Microsoft Graph API not only to aquire a token via "password/username provider" (this type) instead of the "client credential provider" (link) but also to actually trigger a send mail command via Microsoft Graph API (link).

            The client credential provider was in my case not sufficient because the admin had not specified permissions to send mails.

            Thus, I didn't use JavaMail anymore for this and needed another token acquisition provider.



            JavaMail sends no content with SMTP, sends "QUIT" and hangs
            Asked 2022-Feb-28 at 20:54

            I'm trying to use JavaMail 1.6 to send an email to a local MailHog SMTP server in Java 8. The code is:



            Answered 2022-Feb-28 at 20:54

            Answering my own question:

            JavaMail (Maven package javax.mail/javax.mail-api) was moved to Jakarta Mail (com.sun.mail/jakarta.mail). I'm not really sure what's wrong with the old package, but once I updated the appropriate maven dependency from



            my email form submit condition not working
            Asked 2022-Jan-13 at 06:45

            I have an angular app(contact form) and springboot app which i am using for sending email through gmail when the contact form is submitted.

            The issue i am experiencing is that the negative case is not getting captured, in the sense, if my springboot app(email) is down, my angular app still says its success instead of saying "email service is down". Currently what is happening is, in both cases status success is sent, even if the springboot app is down.

            Somewhere my condition is not working, any kind of assistance will be really helpful.

            my contactus.component.ts file is as below:



            Answered 2022-Jan-13 at 06:45

            Got it..After researching alot on the internet, i was able to get the issue fixed. Below import and inputs i had to include to make it work successfully. Adding here so that if other face same issue, they can have a look at this to fix the issue.



            Segregating Springboot app for DEV and PROD Environment for the email app
            Asked 2022-Jan-10 at 14:20

            My springboot App is working fine in DEV environment, and now i would like to segregate DEV and PROD environments in order for it to pickup respective code.

            I did go through few of the tutorials got some lead to it but was not able to come conclusion on how to separate out PROD section.

            This app basically sends an email to gmail on form submission from angular app. This is what i have done till now on the springboot app in order to segregate it.

            I have created and from the actual file and added two separate gmail accounts one for DEV and one for PROD. And added the Profiles to POM.xml

            Any help on how to create a PROD environment from the existing code will be very helpful. I am quite new to springboot and how to go about doing profiling for different environments.

   file (actual file) is :



            Answered 2022-Jan-10 at 14:20

            I have created and from the actual

            This is already very good (except the exposing secrets in git part...), and you are in fact done!

            To activate/override them, you just need to set on the according environment.

            This can be done trough one of the 14(!) spring-boot defined property sources in Chapter 2, Externalized Configuration, e.g.:

            • (java.lang.)System property (6.):



            Sending Emails with Amazon SES and Spring Boot
            Asked 2021-Dec-23 at 23:57

            I have s SpringBoot app. with this dependencies:



            Answered 2021-Dec-23 at 23:57

            Based on the error message, remove the JavaMailSender constructor argument in the NotificationService constructor (assuming you are not using that in the NotificationService).

            In case you wanted to use the JavaMailSender in the NotificationService, you would need to create a Bean of type JavaMailSender which can be injected in the NotificationService. For AWS-SES, you can do so by defining the following bean in your configuration.



            How to disable the mail health check in Spring Boot?
            Asked 2021-Dec-13 at 15:03

            I would like to disable the mail health check in spring boot as the values will be set during runtime. I've found this mentioned in certain GitHub issues for Spring Boot but the configs mentioned vary.

            This is my exception after starting my Spring Boot application.



            Answered 2021-Dec-13 at 15:03


            Why JavaMailSender - starttls does not work
            Asked 2021-Dec-13 at 07:33

            I'm trying to configure mail service in simple spring boot app to send email notifications.

            Here is my config:



            Answered 2021-Dec-13 at 07:33

            I guess your config is not correct. Instead of



            Check for mail server SMTPUTF8 support
            Asked 2021-Nov-09 at 08:26

            I have a system where (registered) users have the possibility to add their own SMTP server for mail sending. Thus I don't know in advance what server a user might add and whether this one supports SMTPUTF8. Now starting from JavaMail 1.6 support for SMTPUTF8 has been added. After enabling this for some servers the following line is printed to the log:

            mail.mime.allowutf8 set but server doesn't advertise SMTPUTF8 support

            This is correct for that server, however how can I detect whether a server supports this or not? I see two possibilities:

            1. Somehow detect whether a mail server supports SMTPUTF8 - if that is possible?
            2. Add another parameter to the stmp configuration and then the users decide (which in most cases they don't really know I would guess)

            So is there a way to detect whether a server supports SMTPUTF8?

            I checked the implementation and the com.sun.mail.SMTPTransport seems to provide such a query possibility.

            public boolean supportsExtension(String ext)

            So calling



            Answered 2021-Nov-09 at 08:26

            Using ESMTP with the EHLO command one can query the smtp server for supported extensions. mail.smtp.ehlo=true; must be enabled.



            MailSendException SSLHandshakeException JavaMail emails not being sent
            Asked 2021-Oct-29 at 11:24

            When sending an email using JavaMail, I get this exception:



            Answered 2021-Oct-29 at 11:24

            Thank you to all those who replied.

            It appears that all the problem was cause by a change on Microsoft policies regarding the basic authentication for their tenants.

            After some changes on the account settings, all is back to normal and the emails are sent again.



            JavaMail-Folder AutoClosable exception
            Asked 2021-Oct-12 at 14:07

            Since JavaMail version 1.6.0 classes Store and Folder (amongst Transport) should implement AutoClosable interface.

            I did not find any examples of someone using JavaMail API with auto-closable.

            After a few tests I am not sure how to exactly use this feature as I have discovered a strange(?) behavior.

            I am using the dependency com.sun.mail:javax.mail:1.6.0



            Answered 2021-Oct-12 at 14:07

            Try to restructure the code as:


            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install javamail

            You can download it from GitHub, Maven.
            You can use javamail like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the javamail component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer For Gradle installation, please refer .


            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link