Package com.axelor.mail
Class AbstractMailAccount
java.lang.Object
com.axelor.mail.AbstractMailAccount
- All Implemented Interfaces:
MailAccount
- Direct Known Subclasses:
ImapAccount
,Pop3Account
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.mail.Session
Get aSession
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.
-
Constructor Details
-
AbstractMailAccount
public AbstractMailAccount(String protocol, String host, String port, String user, String password, String channel) Create a new mail account.- Parameters:
protocol
- server account protocolhost
- server hostnameport
- server portuser
- login namepassword
- login passwordchannel
- encryption channel (ssl, starttls or null)
-
-
Method Details
-
setConnectionTimeout
public void setConnectionTimeout(int connectionTimeout) Description copied from interface:MailAccount
Socket connection timeout value in milliseconds.- Specified by:
setConnectionTimeout
in interfaceMailAccount
- Parameters:
connectionTimeout
- timeout value
-
setTimeout
public void setTimeout(int timeout) Description copied from interface:MailAccount
Socket read timeout value in milliseconds.- Specified by:
setTimeout
in interfaceMailAccount
- Parameters:
timeout
- timeout value
-
setProperties
Description copied from interface:MailAccount
Set additional properties.- Specified by:
setProperties
in interfaceMailAccount
- Parameters:
properties
- the properties to set
-
getSession
public jakarta.mail.Session getSession()Description copied from interface:MailAccount
Get aSession
for this account.
The account implementation can decide whether to cache the session instance or not.- Specified by:
getSession
in interfaceMailAccount
- Returns:
- a
Session
instance.
-