Class SmtpManager

All Implemented Interfaces:
AutoCloseable

public class SmtpManager extends MailManager
Manager for sending SMTP events.
  • Field Details

  • Constructor Details

    • SmtpManager

      protected SmtpManager(String name, javax.mail.Session session, javax.mail.internet.MimeMessage message, MailManager.FactoryData data)
  • Method Details

    • add

      public void add(LogEvent event)
      Description copied from class: MailManager
      Adds an event to the cyclic buffer.
      Specified by:
      add in class MailManager
      Parameters:
      event - The event to add.
    • getSmtpManager

      @Deprecated public static SmtpManager getSmtpManager(Configuration config, String to, String cc, String bcc, String from, String replyTo, String subject, String protocol, String host, int port, String username, String password, boolean isDebug, String filterName, int numElements, SslConfiguration sslConfiguration)
      Deprecated.
    • sendEvents

      public void sendEvents(Layout<?> layout, LogEvent appendEvent)
      Description copied from class: MailManager
      Send the contents of the cyclic buffer as an e-mail message.
      Specified by:
      sendEvents in class MailManager
      Parameters:
      layout - The layout for formatting the events.
      appendEvent - The event that triggered the send.
    • formatContentToBytes

      protected byte[] formatContentToBytes(LogEvent[] priorEvents, LogEvent appendEvent, Layout<?> layout) throws IOException
      Throws:
      IOException
    • writeHeader

      protected void writeHeader(Layout<?> layout, OutputStream out) throws IOException
      Throws:
      IOException
    • writeBuffer

      protected void writeBuffer(LogEvent[] priorEvents, LogEvent appendEvent, Layout<?> layout, OutputStream out) throws IOException
      Throws:
      IOException
    • writeFooter

      protected void writeFooter(Layout<?> layout, OutputStream out) throws IOException
      Throws:
      IOException
    • getEncoding

      protected String getEncoding(byte[] rawBytes, String contentType)
    • encodeContentToBytes

      protected byte[] encodeContentToBytes(byte[] rawBytes, String encoding) throws javax.mail.MessagingException, IOException
      Throws:
      javax.mail.MessagingException
      IOException
    • encodeContent

      protected void encodeContent(byte[] bytes, String encoding, ByteArrayOutputStream out) throws javax.mail.MessagingException, IOException
      Throws:
      javax.mail.MessagingException
      IOException
    • getHeaders

      protected javax.mail.internet.InternetHeaders getHeaders(String contentType, String encoding)
    • getMimeMultipart

      protected javax.mail.internet.MimeMultipart getMimeMultipart(byte[] encodedBytes, javax.mail.internet.InternetHeaders headers) throws javax.mail.MessagingException
      Throws:
      javax.mail.MessagingException
    • sendMultipartMessage

      @Deprecated protected void sendMultipartMessage(javax.mail.internet.MimeMessage msg, javax.mail.internet.MimeMultipart mp) throws javax.mail.MessagingException
      Deprecated.
      Throws:
      javax.mail.MessagingException
    • sendMultipartMessage

      protected void sendMultipartMessage(javax.mail.internet.MimeMessage msg, javax.mail.internet.MimeMultipart mp, String subject) throws javax.mail.MessagingException
      Throws:
      javax.mail.MessagingException