com.solarmosaic.client.mail.Mailer.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mail-client_2.10 Show documentation
Show all versions of mail-client_2.10 Show documentation
Scala mailer built on top of the JavaMail API.
The newest version!
package com.solarmosaic.client.mail
import javax.mail.{Session, Transport}
import com.solarmosaic.client.mail.configuration.SmtpConfiguration
/**
* SMTP mailer.
*
* @param config SMTP configuration for the mailer.
*/
case class Mailer(config: SmtpConfiguration) {
lazy val session: Session = Session.getInstance(config.properties, config.authenticator.orNull)
/** Sends an email message using the given [[Envelope]]. */
def send(envelope: Envelope): Unit = Transport.send(envelope.message(session))
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy