Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-17-2009, 06:36 PM
Starter Member
 
Posts: 2
Smile Accessing to mailbox with ZMailbox.java

Hi gurus,

I need a help here to accessing to my mailbox via java.

Options opt = new ZMailbox.Options();
opt.setAccount("myname@myemail.com");
opt.setPassword("password");
opt.setAccountBy(AccountBy.name);
opt.setUri("https://imap.myurl.com/service/soap/");
ZMailbox mb = ZMailbox.getMailbox(opt);

and then i try to send a mail with just created ZMailbox object.

ZOutgoingMessage out = new ZOutgoingMessage();
ZEmailAddress address = new ZEmailAddress("user@xxx.com", null, null, "t");
List lst = new ArrayList();
lst.add(address);
out.setAddresses(lst);
out.setSubject("testing outgoing mail");
mb.sendMessage(out, "", false);

It works, user@xxx.com received the mail from my account.
and then i try to access to my Inbox folder.

ZFolder folder = mb.getFolderById("2");

If I am not mistaken, getFolderById("2") is same with getFolderByPath("Inbox")

I actually tried both, but I always get NULL returned for the folder.

May I know what would be the possible mistake that I made here?

Thank you!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.