camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bilgin Ibryam <bibr...@gmail.com>
Subject Re: Regarding mail reading
Date Fri, 11 Nov 2011 10:34:29 GMT
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
<ketanbarapatre@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=myusername@gmail.com&password=mypassword";
>  //final String url = "smtp://
> smtp.gmail.com:465?password=mypassword&username=myusername@gmail.com";
>  final String url = "pop3://myusername@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.
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message