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 06-23-2009, 05:18 AM
Active Member
 
Posts: 48
Question Extract Mail Details through Zimlet

Hi
i am new to zimlets .
i have gone through the wiki zimbra and other zimlet codes but am not able to solve this problem .

I want to create a sample zimlet through which il be able to extract the Mail details viz. From field , Subject Field , Body , etc .

I tried doing this ::
1.Creating a var of ZmMailMsg in the js .
var msg = new ZmMailMsg();
Then tried to fetch the from field by simply msg.from and msg.subject (as par a zimlet i have seen ) and the values returned are "undefined".Why is this happening like this ?
What is the mistake in my Coding.
pLease Help me out here.

Its Urgent .
Reply With Quote
  #2 (permalink)  
Old 06-24-2009, 03:05 AM
Intermediate Member
 
Posts: 15
Default

Quote:
Originally Posted by riju123 View Post
1.Creating a var of ZmMailMsg in the js .
var msg = new ZmMailMsg();
Then tried to fetch the from field by simply msg.from and msg.subject (as par a zimlet i have seen ) and the values returned are "undefined".Why is this happening like this ?
Your code creates a new, empty message... msg.from and msg.subject will be undefined until you set them.

To get an existing message, you'll need to do one of the following:
  • set your zimlet up as a drop target, so that users can drag messages over and drop them on the zimlet
  • use a search to get a set of messages to work with
  • implement the onMsgView(msg, oldmsg) method in your zimlet - it'll get called when the user switches to a new message
Reply With Quote
  #3 (permalink)  
Old 06-24-2009, 03:10 AM
Active Member
 
Posts: 48
Default

scotty , thanx a Lot . i think il start with the third option .
Since i dont need a drag and drop thing .
I need to automatically fetch the From and subject fields mainly and store in a variable , soon as i click a mail or switch to other mail .
Reply With Quote
  #4 (permalink)  
Old 06-24-2009, 09:05 AM
Member
 
Posts: 12
Lightbulb

Hello riju123,
I am new bee in zimlet. I want to develop a zimlet which will move duplicate emails to Duplicate folder.

can you please guide me how I can implement the same ?

Thanx in advance.
Reply With Quote
  #5 (permalink)  
Old 06-24-2009, 10:19 PM
Active Member
 
Posts: 48
Default

hi ashish , even i am new to this Zimbra and her Zimlets .
So il not be able to help u in this .
But i think i have seen something similar in the forums .
Better u search in Zimlet Forum to get something useful .

Il let u know if i get something regarding this .
Reply With Quote
  #6 (permalink)  
Old 06-24-2009, 10:43 PM
Member
 
Posts: 12
Default

Ok riju thanx for you reply I will try to search something from my side and let you know about the same when get something from it.
Reply With Quote
  #7 (permalink)  
Old 06-25-2009, 12:45 AM
Active Member
 
Posts: 48
Thumbs up A Solution

Here's a Link which helped me in my Topic More . You Guys can also try it .

[SOLVED] catch events
Reply With Quote
  #8 (permalink)  
Old 06-25-2009, 01:25 AM
Active Member
 
Posts: 48
Default

Hi Scotty ,after implementing the onMsgView(msg, oldmsg) , in a normal mail(ie from same Domain) am able to get the from field by :

var from = msg.getAddress(AjxEmailAddress.FROM);
var address = msg.getAddress(AjxEmailAddress.FROM).address;

and subject by simply calling ::
msg.subject

I gave an alert statement like this
alert('msg.subject ::'+msg.subject+':: oldMsg.subject ::'+oldMsg.subject);

But the only problem am facing is am not getting the Subject or a From field when the mail comes from some other Domain .
Like a Voicemail that am receiving the From value doesnt show up , and its same for the subject .
It cannot fetch the msg.subject from the mail but surprisingly when i click some other mail in my mailbox , this time oldMsg.subject field gives the value of the previous VoiceMail Subject and msg.subject gives the value of the present mail ( which is clicked ) .

Do u have a clue of this behavior ?
I hope am able to make u understand .

Thanks in advance .

Last edited by riju123; 06-28-2009 at 10:16 PM..
Reply With Quote
  #9 (permalink)  
Old 08-13-2009, 06:12 AM
Active Member
 
Posts: 48
Default

Any Reply on the Above Please !!
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.