3 Replies Latest reply on Nov 23, 2007 12:29 PM by heinerniehues

    How to use Mail.send() ?

    heinerniehues

      When i use the email-node the Email transmission in JBPM works fine.

      Now, I created an own ActionHandler for sending emails. But it doesnt works. I tried to use the method

      org.jbpm.mail.Mail.Mail.send(Properties, String, List, String, String)

      but I guess i made something wrong:
      try {
       JbpmConfiguration.Configs.getObject("jbpm.mail.smtp.host");
       Properties p = new Properties();
       p.put("mail.smtp.host", JbpmConfiguration.Configs.getObject("jbpm.mail.smtp.host"));
       p.put("mail.smtp.port", JbpmConfiguration.Configs.getObject("jbpm.mail.smtp.port"));
       p.put("mail.smtp.auth", JbpmConfiguration.Configs.getObject("jbpm.mail.smtp.auth"));
       p.put("mail.smtp.ssl", JbpmConfiguration.Configs.getObject("jbpm.mail.smtp.ssl"));
       p.put("mail.smtp.user", JbpmConfiguration.Configs.getObject("jbpm.mail.smtp.user"));
       p.put("mail.smtp.password", JbpmConfiguration.Configs.getObject("jbpm.mail.smtp.password"));
       List l = new ArrayList();
       l.add("thereceiver@gmail.com");
       Mail.send(p, "username",l, "The subject", "The text");
       } catch (Exception e ) {
       e.printStackTrace();
       }


      A JbpmException: couldnt send email with the cause:
      javax.mail.AuthenticationFailedException

      Actually i am using the same data like for the MailNode..

      best regards