Search code examples
c#fax

Sending Fax through c#


I am trying to develop an application which connects to our company's fax server and sends faxes. I am using FAXComLib for this.

My code looks like this:

FAXCOMLib.FaxServer fs = new FAXCOMLib.FaxServer();
fs.Connect("<Remote Server Name>");            
object obj = fs.CreateDocument("FAXTEST.txt"); 
FaxDoc fd = (FaxDoc)obj;
fd.FaxNumber = "<number>";
fd.RecipientName = "<Reciepient>";
int i = fd.Send();
fs.Disconnect();

The problem is that I cannot connect to the remote server. The COM object throws an error hresult e_fail has been returned from a call to a COM component. This only happens when I am trying to connect to the remote server.

We are using a Multi Function Printer which has the Fax module installed on it. Can you help me figure out what could be going wrong here? or how can I debug this problem?


Solution

  • I just ended up using an external Fax API (http://www.interfax.net/en/dev). It was the most efficient and robust solution we could get in the time frame that we had.