public class SmtpSessionFactory extends Object implements Closeable
SmtpSession instances by connecting to remote servers.
This class is thread-safe.
| Constructor and Description |
|---|
SmtpSessionFactory(SmtpSessionFactoryConfig factoryConfig)
Creates a new factory with the provided configuration.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
CompletableFuture<Void> |
closeAsync()
Closes all sessions created by this factory.
|
CompletableFuture<SmtpClientResponse> |
connect(SmtpSessionConfig config)
Connects to a remote server.
|
public SmtpSessionFactory(SmtpSessionFactoryConfig factoryConfig)
public CompletableFuture<SmtpClientResponse> connect(SmtpSessionConfig config)
config - the configuration to use for the connectionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic CompletableFuture<Void> closeAsync()
Copyright © 2018. All rights reserved.