How to send an email to multiple recipients and hide their addresses using Play Mailer
<p>I am using <a href="https://github.com/playframework/play-mailer" rel="nofollow">Play Mailer</a> with Scala, and I am trying to send the same email to multiple recipients. Is there any way to send my email to multiple recipients separately which means that a recipient cannot see the addresses of the other recipients ? Here is the code used to send the same email to a sequence of emails, so the recipients can see all other addresses in the <code>TO</code> field.</p>

<pre><code>import play.api.libs.mailer._
import java.io.File
import org.apache.commons.mail.EmailAttachment
import javax.inject.Inject
import play.api._
import play.api.mvc._
import scala.concurrent.Future
import play.api.libs.json._

class MailerApi @Inject() (mailerClient: MailerClient) extends Controller {
  def sendEmail = Action.async(parse.json) { request =&gt;
    val subject: String = (request.body \ "subject").as[String]

    val cid = "1234"
    val email = Email(
      subject,
      "ExcelWay &lt;email1@gmail.com&gt;",
      Seq("Miss TO &lt;email2@gmail.com&gt;",&lt;email3@gmail.com&gt;),
      // adds attachment
      attachments = Seq(),
      // sends text, HTML or both...
      bodyText = Some("A text message"),
      bodyHtml = Some("content")
      )
    mailerClient.send(email)
    Future.successful(Ok("ok !!"))
  }
}
</code></pre>