The Mailer Servlet provides a simple REST based service that can be used to send MIME e-mails, including embedded experience MIME parts.

In order to run this, copy com.ibm.lotuslabs.mailer_1.0.0.jar into \domino\workspace\applications\eclipse\plugins and restart the server.

The Servlet only supports POST.  The POST body must be JSON that follows the following data format.

{
   "To": (Required) {A comma separated list of e-mails or canonical names that will appear in the "to" field of the e-mail.},
   "CC": (Optional) {A comma separated list of e-mails or canonical names that will appear in the "cc" field of the e-mail.},
   "BCC": (Optional) {A comma separated list of e-mails or canonical names that will appear in the "bcc" field of the e-mail.},
   "Subject": (Optional) {The subject of the e-mail.},
   "Principal": (Optional) {From whom the e-mail will appear to be sent.  If not provided the current user will be used or "Anonymous" if no current authenticated user exists.},
   "Body":{
      "text_plain": (Optional) {The contents of the text/plain MIME part.},
      "text_html": (Optional) {The contents of the text/html MIME part.},
      "embed_json": (Optional) {The contents of the application/embed+json EE MIME part.  This must be valid JSON.},
      "embed_xml": (Optional) {The content of the application/embed+xml EE MIME part.}
   }
}

Here's an example POST body:
{
   "To":"Stanton Sievers/Acme, Ryan Baxter/Acme",
   "CC":"John Doe/Acme",
   "BCC":"Jane Doe/Acme",
   "Subject":"Test e-mail",
   "Principal":"no-reply@acme.com",
   "Body":{
      "text_plain":"plain text",
      "text_html":"html",
      "embed_json":{'json':'json'},
      "embed_xml":"hi"
   }
}

This servlet can operate in two different ways:
* As a standalone servlet, i.e., http:///mailer
* Through a database, i.e., http:///mailer.nsf/mailer.  

If used standalone the servlet MUST have an authenticated user (via SSO for instance) or else the servlet will return a 400 error.  When used standalone the authenticated user's mail database will be used to create and send the document.
If used through a database the servlet will try to create the document in the database (mailer.nsf in the example above).  This is done in two ways:
* If an authenticated user does not have "Create Document" privileges to the database, their mail file will be used.  
* If an anonymous user does not have "Create Document privileges", the servlet will return a 400 error.  
* Unfortunately if the given user (authenticated or otherwise) has "No Access" to the given database the Domino Server may return a 200 response with the login page as the response body.

For more info on servlets check out this great sample: http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocument&name=Servlet%20Sample

Stanton and Ryan are the authors, Niklas only committer.