cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Cocoon Wiki] Update of "SendMailTransformer" by JashaJoachimsthal
Date Wed, 18 Jan 2006 09:41:10 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Cocoon Wiki" for change notification.

The following page has been changed by JashaJoachimsthal:

New page:
== Using SendMailTransfomer with Cocoon 2.1.8 ==
The SendMailTransformer needs the [ JavaMail] and [
JavaBeans Activation Framework (JAF)] API's from Sun to work. Add them to WEB-INF/lib. Remove
geronimo-spec-javamail-1.3.1-rc5.jar and geronimo-spec-activation-1.0.2-rc4.jar from WEB-INF/lib.

=== Simple example ===
Add this to the transformers in your sitemap
<map:transformer name="sendmail" src="org.apache.cocoon.mail.transformation.SendMailTransformer"/>

Add this in a pipeline in your sitemap
<map:match pattern="mailme">
    <map:generate src="sendmail.xml"/>
    <map:transform type="sendmail"/>
    <map:serialize type="xml"/>

Example of sendmail.xml. The values in this document override those from the sitemap. You
can remove them here if you have set them in the sitemap.
<?xml version="1.0" encoding="UTF-8"?>
<document xmlns:email="">
        <email:subject>My first mail</email:subject>
        <email:body>The body of the mail</email:body>

=== Advanced examples and parameters ===
See the [

=== Problem ===
It doesn't matter which SMTP-Host (or SMTP-Port) you fill in, you get the following error
(unless you have a mailserver running on your machine on port 25):
"Could not connect to SMTP host: localhost, port: 25 ( Connection
refused: connect)"

=== Solution ===
Cocoon uses geronimo-spec-javamail-1.3.1-rc5.jar and geronimo-spec-activation-1.0.2-rc4.jar
(or the version that is included with your distribution) instead of Sun JavaMail and JAF.
Remove geronimo-spec-javamail-1.3.1-rc5.jar and geronimo-spec-activation-1.0.2-rc4.jar from
WEB-INF/lib and restart Cocoon. [[BR]][[BR]]
If this still doesn't work remove geronimo-spec-javamail-1.3.1-rc5.jar from /lib/optional
and remove it in lib/jars.xml (or comment it with <!-- -->). Copy src/blocks/mail/mocks
from Cocoon 2.1.7 to the same directory in Cocoon 2.1.8 and rebuild Cocoon. Then add Sun JavaMail
and Activation into WEB-INF/lib and remove geronimo-spec-activation-1.0.2-rc4.jar.

View raw message