smtpUrl->SetPostMessageFile(aFilePath); smtpUrl->SetUserEmailAddress(aSender);
nsFileSpec aFileSpec (aFilePath); nsCOMPtr<nsIFileSpec> aIFileSpec; NS_NewFileSpecWithSpec(aFileSpec, getter_AddRefs(aIFileSpec)); smtpUrl->SetPostMessageFile(aIFileSpec);  smtpUrl->SetUserEmailAddress((char *) aSender);
nsresult NS_MsgBuildMailtoUrl(const nsFilePath& aFilePath,                              const char* aHostName, const char* aSender, 							  const nsString& aRecipients, nsIUrlListener * aUrlListener, nsIURI ** aUrl){	// mscott: this function is a convience hack until netlib actually dispatches smtp urls.	// in addition until we have a session to get a password, host and other stuff from, we need to use default values....	// ..for testing purposes....		nsresult rv = NS_OK;	nsCOMPtr <nsISmtpUrl> smtpUrl;	rv = nsComponentManager::CreateInstance(kCSmtpUrlCID, NULL, nsCOMTypeInfo<nsISmtpUrl>::GetIID(), getter_AddRefs(smtpUrl));	if (NS_SUCCEEDED(rv) && smtpUrl)	{		// assemble a url spec...        char *recipients = aRecipients.ToNewCString();		char * urlSpec= PR_smprintf("mailto://%s:%d/%s",                                    (const char*)aHostName, 25, recipients ? recipients : "");		if (recipients)			delete [] recipients;		if (urlSpec)		{			nsCOMPtr<nsIMsgMailNewsUrl> url = do_QueryInterface(smtpUrl);			url->SetSpec(urlSpec);			smtpUrl->SetPostMessageFile(aFilePath);			smtpUrl->SetUserEmailAddress(aSender);			url->RegisterListener(aUrlListener);			PR_Free(urlSpec);		}		rv = smtpUrl->QueryInterface(nsCOMTypeInfo<nsIURI>::GetIID(), (void **) aUrl);	 }	 return rv;}