Class MimeMessageBuilder

java.lang.Object
org.apache.logging.log4j.core.net.MimeMessageBuilder
All Implemented Interfaces:
Builder<javax.mail.internet.MimeMessage>

public class MimeMessageBuilder extends Object implements Builder<javax.mail.internet.MimeMessage>
Builder for MimeMessage instances.
  • Constructor Details

    • MimeMessageBuilder

      public MimeMessageBuilder(javax.mail.Session session)
  • Method Details

    • setFrom

      public MimeMessageBuilder setFrom(String from) throws javax.mail.MessagingException
      Throws:
      javax.mail.MessagingException
    • setReplyTo

      public MimeMessageBuilder setReplyTo(String replyTo) throws javax.mail.MessagingException
      Throws:
      javax.mail.MessagingException
    • setRecipients

      public MimeMessageBuilder setRecipients(javax.mail.Message.RecipientType recipientType, String recipients) throws javax.mail.MessagingException
      Throws:
      javax.mail.MessagingException
    • setSubject

      public MimeMessageBuilder setSubject(String subject) throws javax.mail.MessagingException
      Throws:
      javax.mail.MessagingException
    • getMimeMessage

      @Deprecated public javax.mail.internet.MimeMessage getMimeMessage()
      Deprecated.
      Use build().
    • build

      public javax.mail.internet.MimeMessage build()
      Description copied from interface: Builder
      Builds the object after all configuration has been set. This will use default values for any unspecified attributes for the object.
      Specified by:
      build in interface Builder<javax.mail.internet.MimeMessage>
      Returns:
      the configured instance.