Class SmtpClientImpl
java.lang.Object
org.codice.ddf.platform.email.impl.SmtpClientImpl
- All Implemented Interfaces:
org.codice.ddf.platform.email.SmtpClient
Supports unauthenticated connections to a mail server and username/password authenticated
connections over TLS. If the username is not blank and the password is not empty, then auth/tls
will be used.
The method send(Message) will exceute asynchronously in a single thread. The number
of operations awaiting execution is unbounded.
This code is experimental. While this interface is functional and tested, it may change or be removed in a future version of the library.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavax.mail.Sessionsend(javax.mail.Message message) voidsetHostName(String hostName) voidsetPassword(String password) Set the password for the email server.voidsetPortNumber(Integer portNumber) voidsetSecurityLogger(ddf.security.audit.SecurityLogger securityLogger) voidsetUserName(String userName) Set the username for the email server.
-
Constructor Details
-
SmtpClientImpl
public SmtpClientImpl(ddf.security.encryption.EncryptionService encryptionService)
-
-
Method Details
-
setUserName
Set the username for the email server.- Parameters:
userName- the username of the email server
-
setPassword
Set the password for the email server.- Parameters:
password- the password for the email server
-
setHostName
- Parameters:
hostName- must be non-empty
-
setPortNumber
- Parameters:
portNumber- must be non-null and >0
-
setSecurityLogger
public void setSecurityLogger(ddf.security.audit.SecurityLogger securityLogger) -
createSession
public javax.mail.Session createSession()- Specified by:
createSessionin interfaceorg.codice.ddf.platform.email.SmtpClient
-
send
- Specified by:
sendin interfaceorg.codice.ddf.platform.email.SmtpClient
-