Skip to main content

Extract body of message from queue and send to database.

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
No replies
ajmarie27
Offline
Joined: 2011-07-19

This code extract body of message from queue and I need to send it to database.

var content;
var MessageURI = GetFirstSelectedMessage();
var MsgService = messenger.messageServiceFromURI(MessageURI);
var MsgStream = Components.classes["@...org/network/sync-stream-listener;1"].createInstance();
var MsgStrem_Inputstream = MsgStream.QueryInterface(Components.interfaces.nsIInputStream);
var ScriptInput = Components.classes["@...org/scriptableinputstream;1"].createInstance();
var ScriptInputStream = ScriptInput .QueryInterface(Components.interfaces.nsIScriptableInputStream);
ScriptInputStream .init(MsgStream);
try
{
MsgService .streamMessage(MessageURI,MsgStream, msgWindow, null, false, null);
}
catch (ex)
{
return;
}
ScriptInputStream .available();
while (ScriptInputStream .available())
{
content = content + ScriptInputStream .read(512);
}
alert(content);