Hallo everyone!

I'd like my JBI-Component to use the Email feature of SM.

So I wrote following servicemix.xml -snippet:
"<sm:activationSpecs>
            <sm:activationSpec componentName="emailSender"
service="foo:emailSender">
                  <sm:component>
                      <bean
class="org.apache.servicemix.components.email.MimeMailSender">
                        <property name="sender">
                            <bean
class="org.springframework.mail.javamail.JavaMailSenderImpl">
                                <property name="host" value="mysmtpserver"/>
                                <property name="port" value="25"/>
                                <property name="username"
value="Sandra.Schweighart"/>
                                <property name="password"
value="myPassword"/>
                            </bean>
                        </property>
                      </bean>
                    </sm:component>
                </sm:activationSpec>
    </sm:activationSpecs>
"
And in my component I set all properties and send the MessageExchange
through my channel:
"InOnly inOnly = channel.createExchangeFactory().createInOnlyExchange();
NormalizedMessage mailMessage = inOnly.createMessage();
mailMessage.setProperty("org.servicemix.email.to",
"[EMAIL PROTECTED]");
mailMessage.setProperty("org.servicemix.email.from",
"[EMAIL PROTECTED]");
mailMessage.setProperty("org.servicemix.email.text","My Message");
mailMessage.setProperty("org.servicemix.email.subject", "Mail Test");
mailMessage.setProperty("org.servicemix.email.replyTo",
"[EMAIL PROTECTED]");
 inOnly.setInMessage(mailMessage);

QName service = new
QName("http://www.sandraschweighart.de/services","emailSender";);
inOnly.setEndpoint(context.getEndpoint(service, "emailSender"));
channel.send(inOnly);"

But nothing happens. It doesn't send any Email. When I used the SM
2.0.2-version I received an IllegalArgumentException when
MailMarshallerSupport tried to evaluate the "to"-field. So I thought
that SM at least routet to the right service and there was the exception
thrown. Then I took the latest nightly build of SM and now after
"channel.send(inOnly);" nothing happens any more. The component
"emailSender" gets installed. But I miss the message on commandline that
the service "emailSender" has been activated. (it seems that the newer
SM versions don't have that feature any more).

In my oppinion SM doesn't route the message to the emailSender-Service.
Do you have any idea? Where is my mistake?

Greatings
Sandra

Reply via email to