com.dumbster.smtp
public class SimpleSmtpServer extends java.lang.Object implements java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_SMTP_PORT
Default SMTP port is 25.
|
Constructor and Description |
---|
SimpleSmtpServer(int port)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.util.Iterator |
getReceivedEmail()
Get email received by this instance since start up.
|
int |
getReceivedEmailSize()
Get the number of messages received.
|
boolean |
isStopped()
Check if the server has been placed in a stopped state.
|
void |
run()
Main loop of the SMTP server.
|
static SimpleSmtpServer |
start()
Creates an instance of SimpleSmtpServer and starts it.
|
static SimpleSmtpServer |
start(int port)
Creates an instance of SimpleSmtpServer and starts it.
|
void |
stop()
Stops the server.
|
public static final int DEFAULT_SMTP_PORT
public SimpleSmtpServer(int port)
port
- port numberpublic void run()
run
in interface java.lang.Runnable
public boolean isStopped()
public void stop()
public java.util.Iterator getReceivedEmail()
public int getReceivedEmailSize()
public static SimpleSmtpServer start()
public static SimpleSmtpServer start(int port)
port
- port number the server should listen to