« Return to Thread: SMTP transport with e-mail address in DataBase

Re: SMTP transport with e-mail address in DataBase

by bokc bokc :: Rate this Message:

Reply to Author | View in Thread

Hi

I understand your example but I try to juste put the ${email} in the mule configuration. But when I run mule (juste mule/no message for the moment) I have an error :
Exception stack is:
1. Invalid bean definition with name 'smtp' defined in null: Could not resolve placeholder 'email' (org.springframework.beans.factory.BeanDefinitionStoreException)
  org.springframework.beans.factory.config.PropertyPlaceholderConfigurer:268 (null)
2. Invalid bean definition with name 'smtp' defined in null: Could not resolve placeholder 'email' (org.springframework.beans.factory.BeanDefinitionStoreException) (org.mule.api.config.ConfigurationException)
  org.mule.config.builders.AbstractConfigurationBuilder:44 (http://mule.mulesource.org/docs/apidocs/org/mule/api/config/ConfigurationException.html)

My service configuration is :
         <service name="Smtp">
            <inbound>
                <vm:inbound-endpoint path="smtp" />
            </inbound>
            <outbound>
                <outbound-pass-through-router>
                    <smtp:outbound-endpoint address="smtp://smtp.orange.fr" subject="Mule test" from="test@..." to="${email}" transformer-refs="SessionToHtml"/>
                </outbound-pass-through-router>
            </outbound>
        </service>

Did I have to declar it befort ?

youkoun

2008/7/3 coo|dude <cooldude_no1@...>:

I will not write the entire thing here, I think the below will be sufficient
for you. :)

You can do something like that in your class file:

UMOMessage response = eventContext.sendEvent(eventContext.getMessage(),
uri);
               Object emailAdd = response.getPayload();

Map map = new HashMap();
               map.put("email", emailAdd);
client.send("vm://in", "foolie", map);

then in your Mule config file, you can use ${email} for your other connector


bokc bokc wrote:
>
> Hi,
>
> I'm using Mule 2. Do you have an example, even if it was for Mule1 ?
>
> Youkoun
>
> 2008/7/2 coo|dude <cooldude_no1@...>:
>
>>
>> hhmm.. are you using Mule 1.x or Mule 2.x? I am not so sure about Mule
>> 2.x,
>> but in 1.x, you can actually create a normal Java class with getter and
>> setter and this getter and setter can be used as part of the properties
>> attributes of the router.
>>
>>
>>
>> bokc bokc wrote:
>> >
>> > The 2nd solution look like the best but I don't see how to do this?
>> > For The JDBC connector, I know how to do this but how can I use data in
>> > payload object in the SQL query?
>> >
>> > Youkoun
>> >
>> > 2008/7/1 coo|dude <henry.tiong@...>:
>> >
>> >>
>> >> hhmm..
>> >>
>> >> 1. You may need to write a custom filtering to grab the email address
>> at
>> >> the
>> >> router, or
>> >> 2. Use JDBC connector to query the database directly to grab the email
>> >> address and echo is back to another Mule descriptor, or
>> >> 3. Ever thinking of putting the email address onto the Mule's
>> environment
>> >> properties file and grab the value there?
>> >>
>> >> cheers,
>> >>
>> >> bokc bokc wrote:
>> >> >
>> >> > Hi,
>> >> >
>> >> > The e-mail address can change in the data base but the frequency is
>> >> > unknown.
>> >> > I think the easiest way is to put the e-mail in the payload object.
>> But
>> >> > after I don't know how to take and use it in the the smtp transport.
>> >> >
>> >> > Youkoun
>> >> >
>> >> > 2008/7/1 coo|dude <henry.tiong@...>:
>> >> >
>> >> >>
>> >> >> First thing first, is the value of the email address static or it
>> will
>> >> be
>> >> >> changed accordingly (if so, how frequent)?
>> >> >>
>> >> >>
>> >> >> bokc bokc wrote:
>> >> >> >
>> >> >> > Hi,
>> >> >> >
>> >> >> > I would like to send e-mail trow smtp transport. But the e-mail
>> >> address
>> >> >> is
>> >> >> > in data base and it depend of data in the payload. Is it possible
>> to
>> >> >> take
>> >> >> > data in the DataBase with the mule ant put it in the e-mail
>> address
>> >> of
>> >> >> the
>> >> >> > smtp transport ?
>> >> >> > If not I can put it on the object in the payload. But how can I
>> >> extract
>> >> >> it
>> >> >> > for the smtp transport?
>> >> >> >
>> >> >> > Youkoun
>> >> >> >
>> >> >> >
>> >> >>
>> >> >> --
>> >> >> View this message in context:
>> >> >>
>> >>
>> http://www.nabble.com/SMTP-transport-with-e-mail-address-in-DataBase-tp18153616p18211553.html
>> >> >> Sent from the Mule - User mailing list archive at Nabble.com.
>> >> >>
>> >> >>
>> >> >>
>> ---------------------------------------------------------------------
>> >> >> To unsubscribe from this list, please visit:
>> >> >>
>> >> >>    http://xircles.codehaus.org/manage_email
>> >> >>
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/SMTP-transport-with-e-mail-address-in-DataBase-tp18153616p18212282.html
>> >> Sent from the Mule - User mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe from this list, please visit:
>> >>
>> >>    http://xircles.codehaus.org/manage_email
>> >>
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/SMTP-transport-with-e-mail-address-in-DataBase-tp18153616p18230823.html
>> Sent from the Mule - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>

--
View this message in context: http://www.nabble.com/SMTP-transport-with-e-mail-address-in-DataBase-tp18153616p18250848.html
Sent from the Mule - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



 « Return to Thread: SMTP transport with e-mail address in DataBase