Hi,
If you want to extract the content of a mail that you read, then you should access the currentHeaderData (it has 2 components: headerName and headerValue). The info is in headerValue.

The message body can be obtained if you access the browser element in the window (document.getElementById('messagepane')).

To write all this in a file, you need to use a function that uses XPCOM. I will paste it here, so you don't have to look it up:

function writeFilePriv(sFilePath, sFileContent)
{
try
{
netscape.security.PrivilegeManager.enablePrivilege ("UniversalXPConnect");
}
catch (e)
{
alert("Permission UniversalXPConnect denied.");
}
file=Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile );
file.initWithPath(sFilePath);
file.createUnique(Components.interfaces.nsIFile.NO RMAL_FILE_TYPE,420);
outputStream=Components.classes['@mozilla.org/network/file-output-stream;1'].createInstance(Components.interfaces.nsIFileOutpu tStream);
outputStream.init(file,0x04|0x08|0x20,420,0);
outputStream.write(sFileContent, sFileContent.length);
outputStream.close();
}


Just call the function like this:
writeFilePriv(path, your_info);

Regards,
Ioana

Fulg de Nea wrote: Hello guys,

I need to develop a small extension to save the
message in some txt file but I don't know how to
obtain the date, subject, message body, etc. If you
have any ideas please tell me.

Best regards,
Rodica


__________________________________________________ __________________________________
Shape Yahoo! in your own image. Join our Network Research Panel today! http://surveylink.yahoo.com/gmrs/yah...invite.asp?a=7


_______________________________________________
dev-extensions mailing list
dev-extensions@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-extensions



---------------------------------
Be a better Globetrotter. Get better travel answers from someone who knows.
Yahoo! Answers - Check it out.