SendLaterListener *sendLaterListener = new SendLaterListener();
SendLaterListener *sendLaterListener = new SendLaterListener(this);
nsMessenger::SendUnsentMessages(){	nsresult rv;	nsCOMPtr<nsIMsgSendLater> pMsgSendLater; 	rv = nsComponentManager::CreateInstance(kMsgSendLaterCID, NULL,nsCOMTypeInfo<nsIMsgSendLater>::GetIID(),																					(void **)getter_AddRefs(pMsgSendLater)); 	if (NS_SUCCEEDED(rv) && pMsgSendLater) 	{ #ifdef DEBUG		printf("We succesfully obtained a nsIMsgSendLater interface....\n"); #endif    SendLaterListener *sendLaterListener = new SendLaterListener();    if (!sendLaterListener)        return NS_ERROR_FAILURE;    NS_ADDREF(sendLaterListener);    pMsgSendLater->AddListener(sendLaterListener);    // temporary hack to get the current identity    NS_WITH_SERVICE(nsIMsgMailSession, mailSession, kCMsgMailSessionCID, &rv);    if (NS_FAILED(rv)) return rv;        nsCOMPtr<nsIMsgIdentity> identity;    rv = mailSession->GetCurrentIdentity(getter_AddRefs(identity));    if (NS_FAILED(rv)) return rv;          pMsgSendLater->SendUnsentMessages(identity, nsnull);     NS_RELEASE(sendLaterListener);	} 	return NS_OK;}