rem: dump( "\n------------------\nThere is no default account, and I caught an exception in penemail.js on line 45. "+e +"\n--------------------------------\n" ); 
add: alert( "\n------------------\nThere is no default account, and I caught an exception in penemail.js on line 45. "+e +"\n--------------------------------\n" ); 
context: function sendEmail(Subject, Body, To, Cc, Bcc, Attachment, Priority){	/* The message composer component */	var MessageComposeComponent = Components.classes["@mozilla.org/messengercompose/compose;1"];	var MessageComposeService = MessageComposeComponent.getService();	var MessageCompose = MessageComposeService.QueryInterface(Components.interfaces.nsIMsgCompose);	/* The message composer parameters component, needed by MessageCompose in order to initialize */	var MessageComposeParamsComponent = Components.classes["@mozilla.org/messengercompose/composeparams;1"];	var MessageComposeParams = MessageComposeParamsComponent.createInstance(Components.interfaces.nsIMsgComposeParams);	   nsIMsgCompFormat = Components.interfaces.nsIMsgCompFormat;	MessageComposeParams.format = nsIMsgCompFormat.PlainText; // this could be a pref for the user   /* The type of delivery to use, we always use send now */	var MessageDeliverMode = Components.interfaces.nsIMsgCompDeliverMode;	var AccountExists = true;	if ( !hasDefaultAccount())	{		AccountExists = accountSetupError();	}	/* The account manager is needed to get the default identity to send the mail out */	var AccountManagerComponent = Components.classes["@mozilla.org/messenger/account-manager;1"];	var AccountManagerService = AccountManagerComponent.getService();	var AccountManager = AccountManagerService.QueryInterface(Components.interfaces.nsIMsgAccountManager);	try    {      	var Account = AccountManager.defaultAccount;    }   catch(e)   {      dump( "\n------------------\nThere is no default account, and I caught an exception in penemail.js on line 45. "+e +"\n--------------------------------\n" );	   AccountExists = accountSetupError();   }	   if (!AccountExists)	{		return(false);	}	/* try to initialize the message composer, if not return false */	try	{		MessageCompose.Initialize(null, MessageComposeParams);	}	catch(Exception)	{		alert( "can't Initialize"+Exception );      return(false);	}		/* The composer fields that need to be set in order to properly send an email */	/* TODO: should this really be set by the default account or is there going to be	   a system account, or is the system account the default account? */	var MessageComposeFields = MessageCompose.compFields;	if (Subject == "")	{		MessageComposeFields.subject = "[no subject]";	}	else	{		MessageComposeFields.subject = Subject;	}	if (To == "" || To == null)	{		return(false); // the email *has* to be addressed to somebody	}	else	{		MessageComposeFields.to = To;	}	if (Cc != "" && Cc != null)	{		MessageComposeFields.cc = Cc;	}	if (Bcc != "" && Bcc != null)	{		MessageComposeFields.bcc = Bcc;	}	if (Body != "" && Body != null)		MessageComposeFields.body = Body;	if (Attachment != "" && Attachment != null)		MessageComposeFields.attachments = Attachment;	if (Priority != "" && Priority != null)		MessageComposeFields.priority = Priority;	MessageComposeFields.from = Account.email;	/* try to send the email away, don't set a listener, we just trust that it makes it for now :) */	/* TODO: properly set a listener on this action and report errors back to the calling function */	try	{		MessageCompose.SendMsg(MessageDeliverMode.Now, Account.defaultIdentity, null);	}	catch(Exception)	{		alert( "can't SendMsg"+Exception );      return(false);	}	   /* we made it here so everything must be good unless something happens during the transport of the message */	return(true);}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/cc67114f8d44ed7886b4df60d0ac53f700dde18e/calendarMail.js/buggy/calendar/resources/content/calendarMail.js