Class EMailSender
java.lang.Object
com.logicaldoc.core.communication.EMailSender
SMTP E-Mail sender service
- Author:
- Michael Scholz, Matteo Caruso - LogicalDOC
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionintintgetHost()intgetPort()booleanvoidThis method sends an email using the smtp-protocol.voidSends an email by using a given templatevoidSame as send(EMail) but executes in another threadvoidSame as send(EMail, String, Map) but executes in another threadvoidsetAuthEncrypted(boolean authEncrypted) voidsetClientId(String clientId) voidsetClientSecret(String clientSecret) voidsetClientTenant(String clientTenant) voidsetConnectionSecurity(int connectionSecurity) voidsetFolderId(Long folderId) voidsetFoldering(int foldering) voidvoidsetPassword(String password) voidsetPort(int port) voidsetProtocol(String protocol) voidvoidsetTenant(long tenant) voidsetUsername(String username) 
- 
Field Details- 
SECURITY_NONEpublic static final int SECURITY_NONE- See Also:
 
- 
SECURITY_STARTTLSpublic static final int SECURITY_STARTTLS- See Also:
 
- 
SECURITY_TLSpublic static final int SECURITY_TLS- See Also:
 
- 
SECURITY_SSLpublic static final int SECURITY_SSL- See Also:
 
- 
PROTOCOL_SMTP- See Also:
 
- 
PROTOCOL_SMTP_MICROSOFT365- See Also:
 
- 
FOLDERING_NONEpublic static final int FOLDERING_NONE- See Also:
 
- 
FOLDERING_YEARpublic static final int FOLDERING_YEAR- See Also:
 
- 
FOLDERING_MONTHpublic static final int FOLDERING_MONTH- See Also:
 
- 
FOLDERING_DAYpublic static final int FOLDERING_DAY- See Also:
 
 
- 
- 
Constructor Details- 
EMailSenderpublic EMailSender(long tenant) 
- 
EMailSender
- 
EMailSenderpublic EMailSender()
 
- 
- 
Method Details- 
setTenantpublic void setTenant(long tenant) 
- 
getSender
- 
setSender
- 
getHost
- 
setHost
- 
getPassword
- 
setPassword
- 
getPortpublic int getPort()
- 
setPortpublic void setPort(int port) 
- 
getUsername
- 
setUsername
- 
sendAsyncSame as send(EMail, String, Map) but executes in another thread- Parameters:
- email- the email to send
- templateName- the template to use to render the body of the message using the automation engine
- dictionary- map of variable to pass to the automation
 
- 
sendpublic void send(EMail email, String templateName, Map<String, Object> dictionary) throws jakarta.mail.MessagingException, AutomationExceptionSends an email by using a given template- Parameters:
- email- The email to send
- templateName- Name of the template to be applied
- dictionary- The dictionary to be used in the template
- Throws:
- jakarta.mail.MessagingException- raised if the email cannot be sent
- AutomationException- the automation has been evaluated but produced an error
 
- 
sendAsyncSame as send(EMail) but executes in another thread- Parameters:
- email- the email to send
 
- 
sendThis 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:
- jakarta.mail.MessagingException- raised if the email cannot be sent
 
- 
isAuthEncryptedpublic boolean isAuthEncrypted()
- 
setAuthEncryptedpublic void setAuthEncrypted(boolean authEncrypted) 
- 
getConnectionSecuritypublic int getConnectionSecurity()
- 
setConnectionSecuritypublic void setConnectionSecurity(int connectionSecurity) 
- 
getFolderingpublic int getFoldering()
- 
setFolderingpublic void setFoldering(int foldering) 
- 
getFolderId
- 
setFolderId
- 
getProtocol
- 
getClientSecret
- 
getClientId
- 
getClientTenant
- 
setProtocol
- 
setClientSecret
- 
setClientId
- 
setClientTenant
 
-