Results 1 to 9 of 9

Thread: Extract Mail Details through Zimlet

Hybrid View

  1. #1
    Join Date
    May 2009
    Posts
    48
    Rep Power
    6

    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 .

  2. #2
    Join Date
    Mar 2008
    Location
    Stanford, CA
    Posts
    15
    Rep Power
    7

    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

  3. #3
    Join Date
    May 2009
    Posts
    48
    Rep Power
    6

    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 .

  4. #4
    Join Date
    May 2009
    Posts
    48
    Rep Power
    6

    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.

  5. #5
    Join Date
    May 2009
    Posts
    48
    Rep Power
    6

    Default

    Any Reply on the Above Please !!

  6. #6
    Join Date
    Jun 2009
    Location
    India
    Posts
    12
    Rep Power
    6

    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.

  7. #7
    Join Date
    May 2009
    Posts
    48
    Rep Power
    6

    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 .

  8. #8
    Join Date
    Jun 2009
    Location
    India
    Posts
    12
    Rep Power
    6

    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.

  9. #9
    Join Date
    May 2009
    Posts
    48
    Rep Power
    6

    Thumbs up A Solution

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

    http://www.zimbra.com/forums/zimlets...ch-events.html

Similar Threads

  1. Mail deferred with Connection timed out
    By Miklos Kalman in forum Administrators
    Replies: 7
    Last Post: 11-17-2012, 06:11 AM
  2. Replies: 7
    Last Post: 02-03-2011, 07:01 AM
  3. DynDNS and Zimbra
    By afterwego in forum Installation
    Replies: 30
    Last Post: 04-01-2007, 04:34 PM
  4. Tomcat broken after upgrade to 4
    By dotslashroot in forum Migration
    Replies: 13
    Last Post: 01-31-2007, 06:05 PM
  5. Mail not getting to mail boxes
    By ehults in forum Installation
    Replies: 5
    Last Post: 10-31-2005, 09:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •