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

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 11-03-2008, 10:10 AM
Partner (VAR/HSP)
 
Posts: 200
Default [SOLVED] Accessing a whole message in a Zimlet

Hi all,

I am currently writing a zimlet that solely works on email messages (not conversations) and encoutered the following problem:

I want to access the mail message as a whole starting from the first line of the SMTP Header to the last line of the last mime attachement (in one string or stringbuffer). Just like what you get when you right click on a mail in the Webclient and select "Show Original".

In my jsp I want to access the message like:

Code:
Mailbox mbox = MailboxManager.getInstance().getMailboxByAccountId(...);
Message msg = mbox.getMessageById(...);
Then I get the Subject with:

Code:
String subj = msg.getSubject();
With other Mailbox methods I can access other parts of the mail. But how could I access the mail as one string?

My java knowledge is pathetic and I would be really happy if someone could give me a hint...

Regards
Thomas
Reply With Quote
  #2 (permalink)  
Old 11-04-2008, 06:00 AM
Partner (VAR/HSP)
 
Posts: 200
Default

Hi again,

I found a way to access a mail "in one piece"

Code:
MailItem mItem = mbox.getItemById(oct, mid, TYPE_UNKNOWN);
and now:
Code:
mItem.getContentStream()
is what I want....

Regards
Thomas
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.