public final class SenderConnection extends AbstractEmailConnection
PASSWORD_NO_USERNAME_ERROR, protocol, session, USERNAME_NO_PASSWORD_ERROR| Constructor and Description |
|---|
SenderConnection(EmailProtocol protocol,
String username,
String password,
String host,
String port,
long connectionTimeout,
long readTimeout,
long writeTimeout,
Map<String,String> properties)
Creates a new instance.
|
SenderConnection(EmailProtocol protocol,
String username,
String password,
String host,
String port,
long connectionTimeout,
long readTimeout,
long writeTimeout,
Map<String,String> properties,
org.mule.runtime.api.tls.TlsContextFactory tlsContextFactory)
Creates a new instance of the connection secured by TLS.
|
| Modifier and Type | Method and Description |
|---|---|
void |
disconnect()
disconnects the internal client used by the
AbstractEmailConnection instance. |
org.mule.runtime.api.connection.ConnectionValidationResult |
validate()
Checks if the current
AbstractEmailConnection instance is valid or not. |
getSessionpublic SenderConnection(EmailProtocol protocol, String username, String password, String host, String port, long connectionTimeout, long readTimeout, long writeTimeout, Map<String,String> properties) throws EmailConnectionException
protocol - the protocol used to send mails. Smtp or smtpsusername - the username to establish connection with the mail server.password - the password corresponding to the usernamehost - the host name of the mail server.port - the port number of the mail server.connectionTimeout - the socket connection timeoutreadTimeout - the socket read timeoutwriteTimeout - the socket write timeoutproperties - the custom properties added to configure the session.EmailConnectionExceptionpublic SenderConnection(EmailProtocol protocol, String username, String password, String host, String port, long connectionTimeout, long readTimeout, long writeTimeout, Map<String,String> properties, org.mule.runtime.api.tls.TlsContextFactory tlsContextFactory) throws EmailConnectionException
protocol - the protocol used to send mails. Smtp or smtpsusername - the username to establish connection with the mail server.password - the password corresponding to the usernamehost - the host name of the mail server.port - the port number of the mail server.connectionTimeout - the socket connection timeoutreadTimeout - the socket read timeoutwriteTimeout - the socket write timeoutproperties - the custom properties added to configure the session.tlsContextFactory - the tls context factory for creating the context to secure the connectionEmailConnectionExceptionpublic void disconnect()
AbstractEmailConnection instance.disconnect in class AbstractEmailConnectionpublic org.mule.runtime.api.connection.ConnectionValidationResult validate()
AbstractEmailConnection instance is valid or not.
if the SenderConnection instance exists, then the validation will always be successful
validate in class AbstractEmailConnectionConnectionValidationResult indicating if the connection is valid or not.Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.