View Single Post
  #2 (permalink)  
Old 10-16-2008, 02:45 PM
Liox Liox is offline
New Member
 
Posts: 4
Default

Hello again,

today I had a closer look at the ZmZimletBase.js and the ZmMailMsg.js scripts. Voila I found the solution myself.
There is a prototype in the ZmZimletBase.js named "onMsgView" which will called every time you view a new message.

Here a example javascript:

Code:
function GetFromAddress() {
}

GetFromAddress.prototype = new ZmZimletBase();
GetFromAddress.prototype.constructor = GetFromAddress;

GetFromAddress.prototype.onMsgView =
function(msg, oldMsg){
	var from = msg.getAddress(AjxEmailAddress.FROM);
	alert(from);
};
And the appropriate XML File:

Code:
<zimlet name="GetFromAddress" version="1.0" description="Get the sender address and print an alert">
	<include>getFromAddress.js</include>
	<handlerObject>GetFromAddress</handlerObject>
	
</zimlet>
Hope this helps someone else...
Reply With Quote