Welcome to the JavaMail API implementation.
Please refer to CHANGES.txt for a list of the changes since the previous release.
Please see the FAQ at https://javaee.github.io/javamail/FAQ
The JavaMail API jar file "mail.jar" includes the full JavaMail API implementation and the Sun protocol providers - IMAP, SMTP, and POP3. The simplest way to use the JavaMail API is to just use the mail.jar file and ignore the other jar files in this package.
In some cases it may be desirable to minimize the size of the JavaMail API code used by an application (e.g., when downloading with an applet). In this case you might want to include the "mailapi.jar" file, which includes *no* protocol providers, along with just the jar file for the protocol provider you need. For example, an applet that only needs to send mail could use the "mailapi.jar" file and the "smtp.jar" file.
An important note when using the separate protocol provider jar files:
You can't mix and match the Sun protocol providers between different
releases of the JavaMail API. The Sun protocol providers depend on
implementation-specific utility APIs within the mailapi.jar file.
(Third party protocol providers that don't depend on these APIs
should work fine.)
NOTE:The Sun protocol provider documentation is available in javadoc format, see https://docs.microsoft.com/en-us/ in the directory where you extracted the JavaMail API zip file. This documentation describes how to use features of the Sun protocol providers to directly access some features of the SMTP, IMAP, and POP3 protocols that are not otherwise supported by the standard JavaMail API.
This release includes an EXPERIMENTAL Gmail IMAP provider. Normal use of Gmail is handled by the standard "imap" protocol provider, but the new "gimap" protocol provider supports additional Gmail-specific non-standard features. See the javadocs for the com.sun.mail.gimap package for details. Note that the gimap.jar file needs to be added to your CLASSPATH to use this new provider.
On systems that support the Java SASL API (javax.security.sasl, JSR-28), such as J2SE 5.0 and later, the IMAP provider can use the SASL API to find an appropriate authentication mechanism. The SASL API also allows you to plug in support for custom authentication mechanisms. See The Java SASL API Programming and Deployment Guide at https://docs.oracle.com/javase/6/docs/technotes/guides/security/sasl/sasl-refguide.html for details on developing custom SASL mechanisms. See the javadocs for the com.sun.mail.imap package for the properties required to enable and configure SASL support.
This release of JavaMail includes EXPERIMENTAL support for creating and parsing Delivery Status Notifications, as defined by RFC 3462 and RFC 3464. To make use of this support you need to include dsn.jar in your CLASSPATH along with mail.jar. See the javadocs for the com.sun.mail.dsn package for more details.
The DSN package also provides support for creating and parsing Message Disposition Notifications, as defined by RFC 3798.
The APIs unique to this package should be considered EXPERIMENTAL. They may be changed in the future in ways that are incompatible with applications using the current APIs.
This release of JavaMail includes EXPERIMENTAL support for the Microsoft NTLM authentication mechanism used by Exchange. See the file NTLMNOTES.txt for details.
The JavaMail jar files are now OSGi bundles. Please let us know of any problems using JavaMail with OSGi.
If you've found a bug, or if you just need help figuring out how to use the JavaMail API, please try to include the following information in your message to us:
Most of the problems reported to us fail to include enough of the above information to allow us to diagnose your problem. It will save you and us time if you include this information in your first message to us.
By far the most common problems we see are:
Your problem: | Something doesn't work right when talking to my mail server. |
---|---|
Our response: | Turn on session debugging and send us the protocol trace. See the demo program documentation for how to turn on session debugging for the demo programs. In your own program, call "session.setDebug(true);". |
Your problem: | javax.mail or javax.activation classes not found when compiling. |
Our response: | You didn't set CLASSPATH correctly to find mail.jar and activation.jar. See README.txt. |
Your problem: | NoSuchProviderException - No such provider for rfc822. |
Our response: | You unjar'ed mail.jar. Don't. |
Your problem: | How do I create a message with an attachment? |
Our response: | Create a message with a MimeMultipart content. See the sendfile.html and msgmultisendsample.java demo programs. |
Please check the FAQ at https://javaee.github.io/javamail/FAQ before submitting bug reports.
Send your bug reports to:javamail_ww@oracle.com
The IMAP implementation works with IMAP4 and IMAP4rev1 servers.
The current release has been tested with:
Previous releases have been tested with:
The current release of the SMTP implementation has been tested with:
Previous releases have been tested with:
Please send your feedback to this email-address: javamail_ww@oracle.com
Check out our website at:
https://www.oracle.com/technetwork/java/javamail/index.html
You can also find help in the JavaMail forum:
https://community.oracle.com/community/groundbreakers/java/java-ee-java-enterprise-edition/javamail