public interface ClosableSmtpConnection extends AutoCloseable
| Modifier and Type | Field and Description |
|---|---|
static String |
HEADER_MESSAGE_ID |
| Modifier and Type | Method and Description |
|---|---|
void |
addTransportListener(jakarta.mail.event.TransportListener l)
Add a new
TransportListener |
void |
clearListeners()
Clear the list of
TransportListener |
jakarta.mail.Transport |
getDelegate() |
jakarta.mail.Session |
getSession() |
void |
invalidate()
Marks this pooled object to be invalid such that it is not returned in the pool when closed.
|
boolean |
isConnected()
Test if the current connection is connected
|
void |
removeTransportListener(jakarta.mail.event.TransportListener l)
Remove the provided
TransportListener |
void |
sendMessage(jakarta.mail.internet.MimeMessage msg)
Send a message.
|
void |
sendMessage(jakarta.mail.internet.MimeMessage msg,
jakarta.mail.Address[] recipients)
Send a message to a list of recipients
|
void |
sendMessages(jakarta.mail.internet.MimeMessage... msgs)
Send the given array of JavaMail MIME messages in batch.
|
void |
setInvalidateConnectionOnClose(boolean invalid)
Allows setting the invalid flag to true or false
|
closestatic final String HEADER_MESSAGE_ID
void invalidate()
void setInvalidateConnectionOnClose(boolean invalid)
invalid - true if the object should not be returned in the pool when closed.void sendMessage(jakarta.mail.internet.MimeMessage msg,
jakarta.mail.Address[] recipients)
throws jakarta.mail.MessagingException,
MailSendException
msg - recipients - jakarta.mail.MessagingExceptionMailSendExceptionvoid sendMessage(jakarta.mail.internet.MimeMessage msg)
throws jakarta.mail.MessagingException
MimeMessage.getAllRecipients()msg - MimeMessagejakarta.mail.MessagingExceptionvoid sendMessages(jakarta.mail.internet.MimeMessage... msgs)
throws MailSendException
MailSendException.getFailedMessages() will contain the failed messagesmsgs - Array of MimeMessageMailSendException - in case of failure when sending a messageboolean isConnected()
void addTransportListener(jakarta.mail.event.TransportListener l)
TransportListenerl - void removeTransportListener(jakarta.mail.event.TransportListener l)
TransportListenerl - void clearListeners()
TransportListenerjakarta.mail.Transport getDelegate()
Transport associated to this connectionjakarta.mail.Session getSession()
SessionCopyright © 2021. All rights reserved.