All Downloads are FREE. Search and download functionalities are using the official Maven repository.

skinny.mailer.HeaderLines.scala Maven / Gradle / Ivy

There is a newer version: 2.5.2
Show newest version
package skinny.mailer

import scala.collection.JavaConverters._

/**
 * Header lines of MIME message.
 */
case class HeaderLines(message: RichMimeMessage) {

  /**
   * Add a raw RFC 822 header-line.
   */
  def ++=(lines: String) = message.underlying.addHeaderLine(lines)

  /**
   * Add a raw RFC 822 header-line.
   */
  def ++=(lines: Iterable[String]) = lines.foreach(message.underlying.addHeaderLine)

  /**
   * Returns as a Seq value.
   */
  def toSeq: Seq[String] = {
    Option(message.underlying.getAllHeaderLines).map(_.asScala).getOrElse(Nil)
      .map(_.asInstanceOf[String]).toSeq
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy