how to Send a Fax from Fax-Server using C#............ getting Exception

I am Using this code , by i getting Exception Name :

"The handle is Invalid (Exception from HRESULTS :0x80070006 (E_HANDLE))"

One More thing I would like to use fax server , i check the server is funtioning correctly due to send fax form my local machine

any one help me.....................

Code is here

---------------------------------------------------------------------------------------------------------------------------

private void btnSend_Click(object sender, System.EventArgs e)

{

SendFax(txtDocName.Text,Application.StartupPath+@"\"+txtFileName.Text,txtRecipientName.Text,txtRecipientFax.Text);

}

public void SendFax(string DocumentName, string FileName, string RecipientName, string FaxNumber)

{

if (FaxNumber != "")

{

try

{

FAXCOMLib.FaxServer faxServer = new FAXCOMLib.FaxServerClass();

faxServer.Connect("VPNSVR");

FAXCOMLib.FaxDoc faxDoc = (FAXCOMLib.FaxDoc)faxServer.CreateDocument(FileName);

faxDoc.RecipientName = RecipientName;

faxDoc.FaxNumber = FaxNumber;

faxDoc.DisplayName = DocumentName;

int Response = faxDoc.Send();

faxServer.Disconnect();




Answer this question

how to Send a Fax from Fax-Server using C#............ getting Exception