Hello,

In order to better understand Camel, I create a MailComponent instance that
I customize for the protocol and the destination. Then, I register it into
the Camel context with the name "test".

So in my Camel route I use the URI
"test://[EMAIL PROTECTED]" on which I send messages
(see the code bellow), but I get the following exception:

Caused by: javax.mail.NoSuchProviderException: No provider for test
        at javax.mail.Session.getProvider(Session.java:455)

I thought that my customized component would be able to handle incoming
message and send emails!
Any idea on what can be wrong on my approach?

Thank you.


Here the code:

CamelContext camelContext = new DefaultCamelContext();
                
                MailComponent mail = new MailComponent();
                mail.getConfiguration().setProtocol("smtp");
                mail.getConfiguration().setDestination("[EMAIL PROTECTED]");
                
                camelContext.addComponent("test", mail);
                                
                camelContext.addRoutes(new RouteBuilder() {

                    public void configure() {
                        
from("timer:myTimerEvent?fixedRate=true&delay=0&period=1000")
                        .setBody(constant("Salut
!")).to("test://[EMAIL PROTECTED]");                    
                    }
                    
                });
                
                camelContext.start();
...
-- 
View this message in context: 
http://www.nabble.com/My-test-scheme-tf4635115s22882.html#a13236630
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to