Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Mailbox
✓ org.jvnet.mock_javamail.Mailbox
Sends a mock email and checks the mailbox.
import org.jvnet.mock_javamail.Mailbox;
import javax.mail.*;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
public class Test {
public static void main(String[] args) throws Exception {
Mailbox.clearAll();
Session session = Session.getDefaultInstance(new Properties());
MimeMessage msg = new MimeMessage(session);
msg.setFrom(new InternetAddress("from@example.com"));
msg.setRecipient(Message.RecipientType.TO, new InternetAddress("to@example.com"));
msg.setSubject("Test");
msg.setText("Hello");
Transport.send(msg);
System.out.println(Mailbox.get("to@example.com").size());
}
}
Debug
Known issues
No known issues recorded.
Audit
Dependencies
No dependency data recorded yet.