public class SmtpAccount extends Object implements MailAccount
MailAccount
for SMPT accounts.Constructor and Description |
---|
SmtpAccount(String host,
String port)
Create a non-authenticating SMTP account.
|
SmtpAccount(String host,
String port,
String user,
String password)
Create an authenticating SMTP account.
|
SmtpAccount(String host,
String port,
String user,
String password,
String channel)
Create an authenticating SMTP account.
|
Modifier and Type | Method and Description |
---|---|
Session |
getSession()
Get a
Session for this account.The account implementation can decide whether to cache the session instance or not. |
void |
setConnectionTimeout(int connectionTimeout)
Socket connection timeout value in milliseconds.
|
void |
setProperties(Properties properties)
Set additional properties.
|
void |
setTimeout(int timeout)
Socket read timeout value in milliseconds.
|
public SmtpAccount(String host, String port)
host
- the smtp server hostport
- the smtp server portpublic SmtpAccount(String host, String port, String user, String password)
host
- the smtp server hostport
- the smtp server portuser
- the smtp server login user namepassword
- the smtp server login passwordpublic SmtpAccount(String host, String port, String user, String password, String channel)
host
- the smtp server hostport
- the smtp server portuser
- the smtp server login user namepassword
- the smtp server login passwordchannel
- the smtp encryption channel (starttls or ssl)public void setConnectionTimeout(int connectionTimeout)
MailAccount
setConnectionTimeout
in interface MailAccount
connectionTimeout
- timeout valuepublic void setTimeout(int timeout)
MailAccount
setTimeout
in interface MailAccount
timeout
- timeout valuepublic void setProperties(Properties properties)
MailAccount
setProperties
in interface MailAccount
properties
- the properties to setpublic Session getSession()
MailAccount
Session
for this account.getSession
in interface MailAccount
Session
instance.