Class EMailSender
java.lang.Object
com.logicaldoc.core.communication.EMailSender
SMTP E-Mail sender service
- Author:
- Michael Scholz, Matteo Caruso - LogicalDOC
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
int
getHost()
int
getPort()
boolean
void
This method sends an email using the smtp-protocol.void
Sends an email by using a given templatevoid
Same as send(EMail) but executes in another threadvoid
Same as send(EMail, String, Map) but executes in another threadvoid
setAuthEncrypted
(boolean authEncrypted) void
setConnectionSecurity
(int connectionSecurity) void
setFolderId
(Long folderId) void
setFoldering
(int foldering) void
void
setPassword
(String password) void
setPort
(int port) void
void
setTenant
(long tenant) void
setUsername
(String username)
-
Field Details
-
SECURITY_NONE
public static final int SECURITY_NONE- See Also:
-
SECURITY_STARTTLS
public static final int SECURITY_STARTTLS- See Also:
-
SECURITY_TLS
public static final int SECURITY_TLS- See Also:
-
SECURITY_SSL
public static final int SECURITY_SSL- See Also:
-
FOLDERING_NONE
public static final int FOLDERING_NONE- See Also:
-
FOLDERING_YEAR
public static final int FOLDERING_YEAR- See Also:
-
FOLDERING_MONTH
public static final int FOLDERING_MONTH- See Also:
-
FOLDERING_DAY
public static final int FOLDERING_DAY- See Also:
-
-
Constructor Details
-
EMailSender
public EMailSender(long tenant) -
EMailSender
-
EMailSender
public EMailSender()
-
-
Method Details
-
setTenant
public void setTenant(long tenant) -
getSender
-
setSender
-
getHost
-
setHost
-
getPassword
-
setPassword
-
getPort
public int getPort() -
setPort
public void setPort(int port) -
getUsername
-
setUsername
-
sendAsync
Same as send(EMail, String, Map) but executes in another thread- Parameters:
email
- the email to sendtemplateName
- the template to use to render the body of the message using the automation enginedictionary
- map of variable to pass to the automation
-
send
public void send(EMail email, String templateName, Map<String, Object> dictionary) throws javax.mail.MessagingExceptionSends an email by using a given template- Parameters:
email
- The email to sendtemplateName
- Name of the template to be applieddictionary
- The dictionary to be used in the template- Throws:
javax.mail.MessagingException
- raised if the email cannot be sent
-
sendAsync
Same as send(EMail) but executes in another thread- Parameters:
email
- the email to send
-
send
This method sends an email using the smtp-protocol. The email can be a simple mail or a multipart mail containing up to 5 attachments.- Parameters:
email
- E-Mail which should be sent.- Throws:
javax.mail.MessagingException
- raised if the email cannot be sent
-
isAuthEncrypted
public boolean isAuthEncrypted() -
setAuthEncrypted
public void setAuthEncrypted(boolean authEncrypted) -
getConnectionSecurity
public int getConnectionSecurity() -
setConnectionSecurity
public void setConnectionSecurity(int connectionSecurity) -
getFoldering
public int getFoldering() -
setFoldering
public void setFoldering(int foldering) -
getFolderId
-
setFolderId
-