Package rs.mail.queue
Class MessageMailSender
java.lang.Object
rs.mail.queue.MessageMailSender
- All Implemented Interfaces:
MailSender<jakarta.mail.Message>
Sends messages for
javax.mail.Message objects.- Author:
- ralph
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor from system properties.MessageMailSender(jakarta.mail.Session session) Constructor.MessageMailSender(Properties mailProperties) Constructor.MessageMailSender(Properties mailProperties, jakarta.mail.Authenticator authenticator) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionjakarta.mail.SessionReturns the mail session.voidsendMessage(jakarta.mail.Message message, String referenceId) Sends the message object.
-
Constructor Details
-
MessageMailSender
public MessageMailSender()Constructor from system properties. -
MessageMailSender
Constructor.- Parameters:
mailProperties- - the mail properties
-
MessageMailSender
Constructor.- Parameters:
mailProperties- - the mail propertiesauthenticator- - Authenticator object. Used only if a new Session object is created. Otherwise, it must match the Authenticator used to create the Session.
-
MessageMailSender
public MessageMailSender(jakarta.mail.Session session) Constructor.- Parameters:
session- - the mail session
-
-
Method Details
-
getSession
public jakarta.mail.Session getSession()Returns the mail session.- Returns:
- the session
-
sendMessage
Sends the message object.- Specified by:
sendMessagein interfaceMailSender<jakarta.mail.Message>- Parameters:
message- - the message objectreferenceId- - a reference ID for the message- Throws:
Exception- - when sending fails
-