-----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>
- ---
However, my connection does fail with
- ---
...
Caused by: javax.mail.MessagingException: Could not connect to SMTP
host: 127.0.0.1, port: 25;
  nested exception is:
        java.net.ConnectException: Connection refused: connect
        at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1282)
        at 
com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)
        at javax.mail.Service.connect(Service.java:275)
        at javax.mail.Service.connect(Service.java:156)
        at javax.mail.Service.connect(Service.java:105)
        at javax.mail.Transport.send0(Transport.java:168)
        at javax.mail.Transport.send(Transport.java:98)
        at
org.apache.cocoon.mail.MailMessageSender.doSend(MailMessageSender.java:446)
        at
org.apache.cocoon.mail.MailMessageSender.send(MailMessageSender.java:271)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...
- ---
Any idea what goes wrong?

Do I have the wrong expectation to get the Component pre-configured? If
this is not the case, how would I go about configuring it?

Thanks
Kaj


        

- --
[EMAIL PROTECTED]
 http://conficio.blogspot.com/
 ================================================
 |  We teach software one screencast at a time  |
 ================================================
 http://www.conficio.com/
 Tel: +1 (781) 632 5773 - Fax: +1 (781) 207 9159
 Conficio
 P.O.Box 761062,  Melrose,
 MA 02176

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)

iD8DBQFEoI9ERDUvrJRNjTARApKRAJ9hVRzAnTposcf8IARqDuYZH5PeJQCeK4Hc
695hi71zO73Lka9RY4Or+Tw=
=Quu5
-----END PGP SIGNATURE-----

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

Reply via email to