Package rs.mail.queue

Class MessageMailSender

java.lang.Object
rs.mail.queue.MessageMailSender
All Implemented Interfaces:
MailSender<jakarta.mail.Message>

public class MessageMailSender extends Object implements MailSender<jakarta.mail.Message>
Sends messages for javax.mail.Message objects.
Author:
ralph
  • Constructor Details

    • MessageMailSender

      public MessageMailSender()
      Constructor from system properties.
    • MessageMailSender

      public MessageMailSender(Properties mailProperties)
      Constructor.
      Parameters:
      mailProperties - - the mail properties
    • MessageMailSender

      public MessageMailSender(Properties mailProperties, jakarta.mail.Authenticator authenticator)
      Constructor.
      Parameters:
      mailProperties - - the mail properties
      authenticator - - 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

      public void sendMessage(jakarta.mail.Message message, String referenceId) throws Exception
      Sends the message object.
      Specified by:
      sendMessage in interface MailSender<jakarta.mail.Message>
      Parameters:
      message - - the message object
      referenceId - - a reference ID for the message
      Throws:
      Exception - - when sending fails