Greenmail javadoc

A blast from the past!

GreenMail is a Java library that provides a simple way to send and receive email messages. Here's a brief overview of the library and its Javadoc:

What is GreenMail?

GreenMail is a Java library that allows you to send and receive email messages in a controlled environment. It's often used for testing email-based applications, such as sending and receiving emails, verifying email addresses, and testing email notifications.

Features

GreenMail provides the following features:

  1. SMTP Server: GreenMail starts an SMTP server that can be used to send and receive email messages.
  2. POP3 Server: GreenMail also starts a POP3 server that can be used to retrieve email messages.
  3. IMAP Server: GreenMail supports IMAP protocol for retrieving email messages.
  4. Email Message Handling: GreenMail provides methods to send, receive, and manipulate email messages.
  5. Email Address Verification: GreenMail allows you to verify email addresses by sending a verification email and checking if it's received.

Javadoc

Here's a brief overview of the GreenMail Javadoc:

Some of the key methods in the GreenMail Javadoc include:

Getting Started

To use GreenMail, you'll need to add the library to your Java project and configure it to start the email servers. Here's an example of how to use GreenMail:

import com.jeremyjoel.greenmail.GreenMail;
import com.jeremyjoel.greenmail.GreenMailSession;
import com.jeremyjoel.greenmail.GreenMailMessage;

public class GreenMailExample {
    public static void main(String[] args) {
        GreenMail greenMail = new GreenMail();
        greenMail.start();

        GreenMailSession session = greenMail.createSession();
        GreenMailMessage message = new GreenMailMessage("[email protected]", "[email protected]", "Subject", "Body");
        session.sendMessage(message);

        GreenMailMessage receivedMessage = session.receiveMessage();
        System.out.println(receivedMessage.getContent());

        greenMail.stop();
    }
}

This example starts the email servers, sends an email message, receives the message, and prints its content.