rem: var am = Components.classes["@mozilla.org/messenger/account-manager;1"] .getService(Components.interfaces.nsIMsgAccountManager); 
context: function SendUnsentMessages(){  var am = Components.classes["@mozilla.org/messenger/account-manager;1"]               .getService(Components.interfaces.nsIMsgAccountManager);  var msgSendlater = Components.classes["@mozilla.org/messengercompose/sendlater;1"]               .getService(Components.interfaces.nsIMsgSendLater);  var identitiesCount, allIdentities, currentIdentity, numMessages, msgFolder;  if(am) {     allIdentities = am.allIdentities;    identitiesCount = allIdentities.Count();    for (var i = 0; i < identitiesCount; i++) {      currentIdentity = allIdentities.QueryElementAt(i, Components.interfaces.nsIMsgIdentity);      msgFolder = msgSendlater.getUnsentMessagesFolder(currentIdentity);      if(msgFolder) {        numMessages = msgFolder.getTotalMessages(false /* include subfolders */);        if(numMessages > 0) {          messenger.sendUnsentMessages(currentIdentity, msgWindow);          // right now, all identities point to the same unsent messages          // folder, so to avoid sending multiple copies of the          // unsent messages, we only call messenger.SendUnsentMessages() once          // see bug #89150 for details          break;        }      }    }   }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/48e3623411cf71c829eaec3e3e786ad0860262d5/mailWindowOverlay.js/buggy/mailnews/base/resources/content/mailWindowOverlay.js