Java can provide mail services: The general understanding of the mail service is to send and receive mail client, but the use of Java to write the mail server;
First, the mail client:
Web apps are commonly used in two ways depending on the API:
The first type: Java Mail API (javax.mail.*) provided in EE
The Javamail API is an optional package (standard extension) for reading, writing, and sending electronic messages that can be used to establish standards-based e-mail clients that support a variety of Internet mail protocols, including SMTP, POP, IMAP, MIME, NNTP, S/MIME, and other protocols.
Second: Spring API (Spring Mail) for Java Mail encapsulation
Second, mail server
Commonly used is Apache James (Java Apache Mail Enterprise Server), completely using pure Java technology development, the implementation of SMTP, POP3 and NNTP and other mail-related protocols. James is a mail application platform that can expand its capabilities through Mailet, such as Mail2sms, Mail2fax, and more. James provides a more complete configuration, especially for the message content store and the user Information Store section, which you can choose to save in a file, database, or other media. James Performance is stable, configurable, open source.
One of the Java Mail Service learning: Mail Service overview