Package com.axelor.mail
Class SmtpAccount
java.lang.Object
com.axelor.mail.SmtpAccount
- All Implemented Interfaces:
MailAccount
The default implementation of
MailAccount for SMPT accounts.-
Constructor Summary
ConstructorsConstructorDescriptionSmtpAccount(String host, String port) Create a non-authenticating SMTP account.SmtpAccount(String host, String port, String user, String password) Create an authenticating SMTP account.Create an authenticating SMTP account.Create an authenticating SMTP account. -
Method Summary
Modifier and TypeMethodDescriptionjakarta.mail.SessionGet aSessionfor this account.
The account implementation can decide whether to cache the session instance or not.voidsetConnectionTimeout(int connectionTimeout) Socket connection timeout value in milliseconds.voidsetProperties(Properties properties) Set additional properties.voidsetTimeout(int timeout) Socket read timeout value in milliseconds.
-
Constructor Details
-
SmtpAccount
Create a non-authenticating SMTP account.- Parameters:
host- the smtp server hostport- the smtp server port
-
SmtpAccount
Create an authenticating SMTP account.- Parameters:
host- the smtp server hostport- the smtp server portuser- the smtp server login user namepassword- the smtp server login password
-
SmtpAccount
Create an authenticating SMTP account.- Parameters:
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)
-
SmtpAccount
public SmtpAccount(String host, String port, String user, String password, String channel, String from) Create an authenticating SMTP account.- Parameters:
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)from- the envelope return address
-
-
Method Details
-
setConnectionTimeout
public void setConnectionTimeout(int connectionTimeout) Description copied from interface:MailAccountSocket connection timeout value in milliseconds.- Specified by:
setConnectionTimeoutin interfaceMailAccount- Parameters:
connectionTimeout- timeout value
-
setTimeout
public void setTimeout(int timeout) Description copied from interface:MailAccountSocket read timeout value in milliseconds.- Specified by:
setTimeoutin interfaceMailAccount- Parameters:
timeout- timeout value
-
setProperties
Description copied from interface:MailAccountSet additional properties.- Specified by:
setPropertiesin interfaceMailAccount- Parameters:
properties- the properties to set
-
getSession
public jakarta.mail.Session getSession()Description copied from interface:MailAccountGet aSessionfor this account.
The account implementation can decide whether to cache the session instance or not.- Specified by:
getSessionin interfaceMailAccount- Returns:
- a
Sessioninstance.
-