can you please help me write this in camel
public class GmailReader{
public static void main(String args[]) throws IOException {
Properties props = System.getProperties();
props.setProperty("mail.store.protocol", "imaps");
try {
Session session = Session.getDefaultInstance(props, null);
Store store = session.getStore("imaps");
store.connect("pop.gmail.com", "[email protected]",
"password");
System.out.println(store);
Folder inbox = store.getFolder("inbox");
inbox.open(Folder.READ_ONLY);
Message messages[] = inbox.getMessages();
for(Message message:messages) {
System.out.println(message.getContent().toString());
}
} catch (Exception e) {
e.printStackTrace();
}
}
in the above code protocol is imaps , emailaddress is [email protected]
and passowrd is password
please write this in camel form
what I am trying is
from("imaps://[email protected]?password=password").
choice().when(header("subject").contains("Test-Camel")).
to("jms://email.queue").bean(new SomeBean());
please tell me the write code.
--
View this message in context:
http://camel.465427.n5.nabble.com/email-listener-tp4429925p4442882.html
Sent from the Camel - Users mailing list archive at Nabble.com.