Hi Ketan, Please read (again) the SSL section of mail component documentation from Camel website and check the example there. Then you have to enable pop for your gmail account in the settings.
Finally the rout should look like something like this: pop3s://pop.gmail.com?username=.... or imaps://imap.gmail.com?username=... notice the S in the schemas HTH Bilgin On Thu, Nov 10, 2011 at 3:22 PM, Ketan Barapatre <ketanbarapa...@gmail.com>wrote: > Hello All, > > To poll the mail. I tried following code > > CamelContext myCamelContext = new DefaultCamelContext(); > //final String url = "imap:// > imap.gmail.com?username=myusern...@gmail.com&password=mypassword"; > //final String url = "smtp:// > smtp.gmail.com:465?password=mypassword&username=myusern...@gmail.com"; > final String url = "pop3://myusern...@gmail.com?password=mypassword"; > Endpoint endpoint = myCamelContext.getEndpoint(url); > System.out.println(" endpoint " + endpoint); > > RouteBuilder routeBuilder = new RouteBuilder(myCamelContext) { > @Override > public void configure() throws Exception { > from(url).process(new MyMailProcessor()); > } > }; > > myCamelContext.addRoutes(routeBuilder); > myCamelContext.start(); > MyMailProcessor.java > > public class MyMailProcessor implements Processor { > > public void process(Exchange exchng) throws Exception { > System.out.println("" + exchng); > } > } > > As i understand when message is read from my Inbox *process* method of > MyMailProcessor executes. > > Please correct me if i'm wrong. I am very new to this. > > I am using camel-mail v2.8.2 and NetBeans 7 on Win XP. > > >