cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [DAISY] Updated: SendMailTransformer
Date Fri, 18 Aug 2006 12:50:13 GMT
A document has been updated:

Document ID: 1099
Branch: main
Language: default
Name: SendMailTransformer (unchanged)
Document Type: Sitemap Component (unchanged)
Updated on: 8/18/06 12:50:02 PM
Updated by: Helma van der Linden

A new version has been created, state: publish


Long description
This part has been added.
Mime type: text/xml
File name: null
Size: 3216 bytes

<h1>Using SendMailTransfomer with Cocoon 2.1.8 or recent</h1>

<p class="note">The SendMailTransformer needs the
<a href="">JavaMail</a> and
<a href="">JavaBeans
Activation Framework (JAF)</a> API's from Sun to work. Add them to WEB-INF/lib.
Remove geronimo-spec-javamail-*.jar and geronimo-spec-activation-*.jar from
WEB-INF/lib. For more information, see <a href="#Problem">Problem &amp;

<h2>Simple example</h2>

<p>Add this to the transformers in your sitemap</p>

<pre>&lt;map:transformer name="sendmail" src="org.apache.cocoon.mail.transformation.SendMailTransformer"/&gt;

<p>Add this in a pipeline in your sitemap</p>

<pre>&lt;map:match pattern="mailme"&gt;
    &lt;map:generate src="sendmail.xml"/&gt;
    &lt;map:transform type="sendmail"/&gt;
    &lt;map:serialize type="xml"/&gt;

<p>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.</p>

<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;document xmlns:email=""&gt;
        &lt;email:subject&gt;My first mail&lt;/email:subject&gt;
        &lt;email:body&gt;The body of the mail&lt;/email:body&gt;

<h2>Advanced examples and parameters</h2>

theĀ <a href="">

<h2 id="Problem">Problem &amp; Solution</h2>


<p>It doesn't matter which SMTP-Host (or SMTP-Port) you fill in, you get the
following error:</p>

<pre>"Could not connect to SMTP host: localhost, port: 25 (
Connection refused: connect)"

<p>if you have a mailserver running on your machine on port 25:</p>

<pre>Exception sending mail java.lang.ClassCastException: java.lang.String


<p>Cocoon uses geronimo-spec-javamail-*.jar and geronimo-spec-activation-*.jar
instead of Sun <a href="">JavaMail</a>
and JAF.</p>

<p>Due to licensing issues, it is not possible to ship the Sun jars with Cocoon,
but without these jars, Cocoon would not compile. Therefore the geronimo jars
are included.</p>

<p>Remove geronimo-spec-javamail-*.jar and geronimo-spec-activation-*.jar from
WEB-INF/lib and restart Cocoon.</p>

<p>If this still doesn't work remove geronimo-spec-javamail-*.jar from
/lib/optional and remove it in lib/jars.xml (or comment it with &lt;!-- --&gt;).
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
<a href="">JavaMail</a> and Activation
into WEB-INF/lib and remove geronimo-spec-activation-*.jar.</p>


View raw message