Exception attempting to send fax from C#

tjlm

New Member
Hi,

I am attempting to send a fax programatically using C# and .Net 2.0. The following is the relevant test code:

try
{
FAXCOMEXLib.FaxServer fs = new FAXCOMEXLib.FaxServer();
fs.Connect("Fax");
FAXCOMEXLib.FaxDocument fd = new FAXCOMEXLib.FaxDocument();
fd.Body = "This is the fax text.";

fd.Recipients.Add("905-123-1234", "Test Recipient Name");
//This JobID[0] can be used to store the JobID of the fax job for later reference.
string[] JobID = (string[])fd.ConnectedSubmit(fs);
FAXCOMEXLib.FaxOutgoingQueue foq = fs.Folders.OutgoingQueue;
foq.Refresh();
string returnval = "";
foreach (FAXCOMEXLib.FaxOutgoingJob foj in foq.GetJobs())
{
returnval += foj.Id + ": " + foj.SubmissionTime + ": " + foj.Status + "/" + foj.ExtendedStatus + Convert.ToChar(10);
}
fs.Disconnect();
}
catch (Exception ex)
{
WriteLog("Exception caught SendFaxMessage: " + ex.ToString());
}
}
}

An exception is thrown as soon as I attempt to connect to the Fax driver:
fs.Connect("Fax");

The exception details are:

System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)

"Fax" is the name of the Microsoft Shared Fax Driver (Windows Fax and Scan in Windows Ultimate with Servvice Pack 1).

Any advice wuld be appreciated.

P.S. If this is not the correct forum please let me know.

Thanks
 

My Computer

Back
Top