Search code examples
javaplayframeworkmailerplayframework-2.2

What Mailer for Play Framework 2.2?


Someone could reccomend me what mailer install on the new Play 2.2.1 (java)? And how to install?

From older questions I've seen that the TypeSafe one is developed by Play creators that it should be good about compatibility but it doesn't send email with attachments, and they don't specify the dependencies to use on Play 2.2. Another suggestion I found is Apache mail (this seems to send also attachments), but don't know if works on 2.2 and how to install it. I'm finding lack of documentation on this side.

I'd like a lightweight Mailer that doesn't install tons of library.


Solution

  • How to install:

    For unmanaged dependency just download the binaries, unzip it and copy the required *.jar files into lib folder in your project (create it if doesn't exists).

    Optionally if you can find required package in Maven repository, you can just add a managed dependency to your build file (in SBT format).

    Both approaches are clearly described in the Play's dependencies doc.

    Just tip: after adding dependencies, clean the build, update dependencies and re-create configuration for your prefered IDE if required.

    Edit:

    Here you've got all Apache's commons in Maven: http://mvnrepository.com/artifact/org.apache.commons

    Just go to last version of required lib and copy required dependency format (from SBT tab in this case) and use as described in above docs.

    FYI: Play already imports some commons libraries ie. lang3, others like io, email etc you can import additionally if required.