HOME

TheInfoList



OR:

Jakarta Mail (formerly JavaMail) is a
Jakarta EE Jakarta EE, formerly Java Platform, Enterprise Edition (Java EE) and Java 2 Platform, Enterprise Edition (J2EE), is a set of specifications, extending Java SE with specifications for enterprise features such as distributed computing and web se ...
API used to send and receive
email Electronic mail (email or e-mail) is a method of exchanging messages ("mail") between people using electronic devices. Email was thus conceived as the electronic ( digital) version of, or counterpart to, mail, at a time when "mail" mean ...
via
SMTP The Simple Mail Transfer Protocol (SMTP) is an Internet standard communication protocol for electronic mail transmission. Mail servers and other message transfer agents use SMTP to send and receive mail messages. User-level email clients typic ...
,
POP3 In computing, the Post Office Protocol (POP) is an application-layer Internet standard protocol used by e-mail clients to retrieve e-mail from a mail server. POP version 3 (POP3) is the version in common use, and along with IMAP the most comm ...
and
IMAP In computing, the Internet Message Access Protocol (IMAP) is an Internet standard protocol used by email clients to retrieve email messages from a mail server over a TCP/IP connection. IMAP is defined by . IMAP was designed with the goal of pe ...
. Jakarta Mail is built into the
Java EE Jakarta EE, formerly Java Platform, Enterprise Edition (Java EE) and Java 2 Platform, Enterprise Edition (J2EE), is a set of specifications, extending Java SE with specifications for enterprise features such as distributed computing and web se ...
platform, but also provides an optional package for use in
Java SE Java Platform, Standard Edition (Java SE) is a computing platform for development and deployment of portable code for desktop and server environments. Java SE was formerly known as Java 2 Platform, Standard Edition (J2SE). The platform uses J ...
. The current version is 2.1.1, released on December 15, 2022. Another
open source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
Jakarta Mail implementation exists - GNU JavaMail - while supporting only version 1.3 of JavaMail specification, it provides the only free
NNTP The Network News Transfer Protocol (NNTP) is an application protocol used for transporting Usenet news articles (''netnews'') between news servers, and for reading/posting articles by the end user client applications. Brian Kantor of the Univ ...
backend, which makes it possible to use this technology to read and send
news group A Usenet newsgroup is a repository usually within the Usenet system, for messages posted from users in different locations using the Internet. They are discussion groups and are not devoted to publishing news. Newsgroups are technically dist ...
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 https://projects.eclipse.org/projects/ee4j.angus Maven co-ordinates of the relevant projects required for operation are: * mail API: jakarta.mail:jakarta.mail-api:2.1.1 * mail implementation: org.eclipse.angus:angus-mail:2.0.1 * multimedia extensions: jakarta.activation:jakarta.activation-api:2.1.1


Licensing

Jakarta Mail is hosted as an
open source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
project on
Eclipse.org The Eclipse Foundation AISBL is an independent, Europe-based not-for-profit corporation that acts as a steward of the Eclipse open source software development community, with legal jurisdiction in the European Union. It is an organization suppo ...
under its new name ''Jakarta Mail''. Most of the Jakarta Mail source code is licensed under the following licences: * EPL-2.0 * GPL-2.0 with Classpath Exception license * The source code for the demo programs is licensed under the BSD license


Examples

import jakarta.mail.*; import jakarta.mail.internet.*; import java.time.*; import java.util.*; // Send a simple, single part, text/plain e-mail public class TestEmail Sample Code to Send Multipart E-Mail, HTML E-Mail and File Attachments package org.example; import jakarta.activation.*; import jakarta.mail.*; import jakarta.mail.internet.*; import java.io.*; import java.time.*; import java.util.*; public class SendMailUsage


References


External links

*
Jakarta Mail EE4J project page




obsolete, but contains code for an NNTP backend {{Jakarta EE Email Java platform Java enterprise platform