public static class MailServer.Builder
extends java.lang.Object
MailServer
.ImapServer
,
ImapSslServer
,
Pop3Server
,
Pop3SslServer
,
SmtpServer
,
SmtpSslServer
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
MailServer.Builder |
auth(javax.mail.Authenticator authenticator)
Sets the authenticator.
|
MailServer.Builder |
auth(java.lang.String username,
java.lang.String password)
Sets authenticator as
SimpleAuthenticator using username and password. |
ImapServer |
buildImapMailServer()
Create a
ImapServer from current data. |
Pop3Server |
buildPop3MailServer()
Create a
Pop3Server from current data. |
SmtpServer |
buildSmtpMailServer()
Create a
SmtpServer from current data. |
MailServer.Builder |
debugMode(boolean debug)
Enable or disable debug mode.
|
MailServer.Builder |
host(java.lang.String host)
Sets the host.
|
MailServer.Builder |
port(int port)
Sets the port.
|
MailServer.Builder |
property(java.lang.String name,
java.lang.String value) |
MailServer.Builder |
ssl(boolean ssl)
Sets the SSL implementation of the Mail server.
|
MailServer.Builder |
storeAttachmentsIn(java.io.File attachmentStorage)
Defines attachment storage, a folder where attachments will be saved.
|
MailServer.Builder |
strictAddress(boolean strictAddress)
Disables the strict address.
|
MailServer.Builder |
timeout(int timeout)
Defines timeout value in milliseconds for all mail-related operations.
|
public MailServer.Builder host(java.lang.String host)
host
- The host to set.public MailServer.Builder port(int port)
port
- The port to set.public MailServer.Builder ssl(boolean ssl)
ssl
- SSL flagpublic MailServer.Builder storeAttachmentsIn(java.io.File attachmentStorage)
public MailServer.Builder auth(java.lang.String username, java.lang.String password)
SimpleAuthenticator
using username and password.username
- The username to use.password
- The password to use.public MailServer.Builder auth(javax.mail.Authenticator authenticator)
authenticator
- Authenticator
to set.public MailServer.Builder debugMode(boolean debug)
debug
- true
to turn on debugging. By default, this is false
.public MailServer.Builder timeout(int timeout)
timeout
- timeout value in milliseconds.public MailServer.Builder strictAddress(boolean strictAddress)
strictAddress
- true
if strict address checking should be be turned on. By default, this is true
.public MailServer.Builder property(java.lang.String name, java.lang.String value)
public ImapServer buildImapMailServer()
ImapServer
from current data.ImapServer
from current data.public Pop3Server buildPop3MailServer()
Pop3Server
from current data.Pop3Server
from current data.public SmtpServer buildSmtpMailServer()
SmtpServer
from current data.SmtpServer
from current data.Copyright © 2003-present Jodd Team