Jakarta Mail (formerly JavaMail) is a Jakarta EE API used to send and receive email via SMTP, POP3 and IMAP. Jakarta Mail is built into the Jakarta EE platform, but also provides an optional package for use in Java SE.[1]
The current version is 2.1.3, released on February 29, 2024.[2] Another open source Jakarta Mail implementation exists (GNU JavaMail), which -while supporting only the obsolete JavaMail 1.3 specification- provides the only free NNTP backend, which makes it possible to use this technology to read and send news group articles.
As of 2019, the software is known as Jakarta Mail, and is part of the Jakarta EE brand (formerly known as Java EE). The reference implementation is part of the Eclipse Angus project.
Maven coordinates of the relevant projects required for operation are:
Jakarta Mail is hosted as an open source project on Eclipse.org under its new name Jakarta Mail.[3]
Most of the Jakarta Mail source code is licensed under the following licences:
import java.time.*;import java.util.*;
// Send a simple, single part, text/plain e-mailpublic class TestEmail
Sample Code to Send Multipart E-Mail, HTML E-Mail and File Attachments
import jakarta.activation.*;import jakarta.mail.*;import jakarta.mail.internet.*;
import java.io.*;import java.time.*;import java.util.*;
public class SendMailUsage