Mail from Cocoon is fun and easy

cocoon

Believe it or not, today is the first time that I used the Cocoon mail block, to create an example for a customer.

What I found is that it's dead easy to use: activate the mail block, download two jars which cannot be distributed with Cocoon (mail.jar and activation.jar), feed a document like the example below to the SendmailTransformer and you're done. Of course, all the components of the transformer's input document (including binary attachments) can be generated dynamically using Cocoon pipelines.

The transformer output indicates whether the message was successfully sent to each address, it's really simple and very useful. You should be prepared to receive spam lots of interesting messages from my next Cocoon application ;-)

your.smtp.server cocoon@codeconsult.ch bdelacretaz@codeconsult.ch someone-else@codeconsult.ch This is a test, from sendmail-input.xml This is the body of the test message. By using src="cocoon:/somepipeline" in the email:body element, this could be generated dynamically from a Cocoon pipeline. The message contains three attachments: a small PDF logo, and HTML document with a single line in it, and a PDF document. <-- use pipelines for attachments to show how this works --> This is supposed to be an HTML attachment.