Scala and Gmail

I was looking for a Scala-esque wrapper around Apache Commons Email and I’ve found just that in this Gist which I’ve forked to add the configuration details using Typesafe Config.

As far as the addition goes, it’s a function to add the Email hostname/port/ssl/smtpserver/username/password:

      def withResources = (email:Email) => {
        val conf = ConfigFactory.load

The original Gist is constructing the Email flavour according to the need (html/simple/attachement) which I am wrapping around a Some (since the case is exhaustive) so I can then map it to the above function to add the underlying configs.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s