[jboss-user] [JBoss jBPM] - Problem sending mails

rodosa do-not-reply at jboss.com
Wed Mar 26 05:48:00 EDT 2008


Hello!!

       I'm trying sending mails but I don't get it. I've tried two differents ways to do it. 

1) Mail-node. It's code is:


  | <mail-node name="Enviar notificacion" to="xxx at hotmail.com">
  | 		<subject>
  | 			Prueba
  | 		</subject>
  | 		<text>
  | 			Prueba Jbpm
  | 		</text>
  | 		<transition to="Fin" name="t2"></transition>
  | 	</mail-node>
  | 

and jbpm.cgf is


  | <jbpm-configuration>
  | 
  |   <!-- 
  |     The default configurations can be found in org/jbpm/default.jbpm.cfg.xml 
  |     Those configurations can be overwritten by putting this file called 
  |     jbpm.cfg.xml on the root of the classpath and put in the customized values.
  |   -->
  | 
  |   <string name="jbpm.mail.smtp.host" value="smtp.xxx.es" />
  |   <bean   name="jbpm.mail.address.resolver" class="org.jbpm.identity.mail.IdentityAddressResolver" singleton="true" />
  |   
  |   <string name="jbpm.mail.user" value="xxx" />
  |   <string name="jbpm.mail.pass" value="xxx" />
  |   <string name="jbpm.mail.from.address" value="xxx at gmail.com"/>
  |    <string name="jbpm.mail.port" value="25" />
  |     <string name="jbpm.mail.smtp.auth" value="true" />
  |   <string name="jbpm.mail.debug" value="true" />
  |   
  |   
  | </jbpm-configuration>
  | 
  | 

It doesn't work. If I put the jbpm.mail.smtp.auth a true the authentication fail, and if I put it to false the error is this:


  | Recipient address rejected: Access denied  554 + "Invalid Addresses"
  | 


2) The second way is declare a node in which handler I try to send a mail. But occurs the similar problem:


  | package handlers;
  | 
  | import java.util.ArrayList;
  | import java.util.List;
  | import java.util.Properties;
  | 
  | import org.jbpm.JbpmConfiguration;
  | import org.jbpm.graph.def.ActionHandler;
  | import org.jbpm.graph.exe.ExecutionContext;
  | import org.jbpm.mail.Mail;
  | 
  | 
  | public class MyMailAction implements ActionHandler {
  | 	
  | 	private static final long serialVersionUID = 1L;
  | 
  | 	public void execute(ExecutionContext context) throws Exception {
  | 		 System.out.println("---->>>Estoy en execution context");
  | 		 
  | 		 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.port"));
  |              p.put("mail.smtp.auth", JbpmConfiguration.Configs.getObject("jbpm.mail.smtp.auth"));
  |              p.put("mail.smtp.user", JbpmConfiguration.Configs.getObject("jbpm.mail.user"));
  |              p.put("mail.smtp.password", JbpmConfiguration.Configs.getObject("jbpm.mail.pass"));
  |              p.put("mail.debug", JbpmConfiguration.Configs.getObject("jbpm.mail.debug"));
  |              p.put("mail.from.address", JbpmConfiguration.Configs.getObject("jbpm.mail.from.address"));
  |              p.put("mail.class.name", JbpmConfiguration.Configs.getObject("mail.class.name"));
  |              List l = new ArrayList();
  |              l.add("xxxx at hotmail.com");
  |              Mail.send(p, "sss at gmail.com",l, "The subject", "The text");
  |          } catch (Exception e ) {
  |              e.printStackTrace();
  |          }	
  |          System.out.println("---->>>Estoy en execution context");
  |          	}
  | 		 
  | 	      
  | }
  | 

I realized that exist mail-service.xml ... It's using this file. How can I dolve this?

Thanks

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4138905#4138905

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4138905



More information about the jboss-user mailing list