Kaj Kandler wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi there,
I'm stuck and look for the magic touch of a master here.

I try to access a component in flow-script like
- ---
var mailSender = cocoon.getComponent("org.apache.cocoon.mail.MailSender");
//      mailSender.initialize();
try {
        mailSender.setFrom(form.getChild("email").getValue());
        mailSender.setTo(recepientAddress);
        mailSender.setSubject("Plan-B4OOo: question from
"+form.getChild("name").getValue());
        mailSender.setBody(form.getChild("question").getValue());
        mailSender.send();
} finally {
        cocoon.releaseComponent(mailSender);
}
- ---
I would expect the component to be configured with the values defined in
 cocoon.xconf
- ---
    <component class="org.apache.cocoon.mail.MailMessageSender"
logger="core.mail.MailSender" role="org.apache.cocoon.mail.MailSender">
      <!--+
          | SMTP host name, user name, and password.
      <smtp-host>svn</smtp-host>
      <smtp-user>myUser</smtp-user>
      <smtp-password>secretPasswd</smtp-password>
          +-->
    </component>

The configuration is commented out... or is that just a copy-paste error? :-)

It should work as you describe, as I'm doing the exact same thing successfully.

--Jason

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to