Search code examples
c#.netasp.netwindowsfax

Sending Fax through .NET/C#


How do I go about sending fax in .NET? We have a fax server through which we need to fax documents to clients. Since we have a fax server, I don't imagine that I have to configure a fax modem on my machine, right? It would just go through the fax server?

Are there any good free (or cheap) Fax APIs out there? IN my research I've come across FAXCOMEXLib, FaxMan, and Windows Fax Service, but the documentation seems limited, so I am hoping someone here can point me in the right direction.

Thanks!


Solution

  • As far as I know, .NET doesn't have anything built in to directly support sending faxes via a fax server. Absent that, you'd probably want to use the COM interface to the fax server. Basically, you create a FaxServer object and invoke its Connect method to connect to the fax server. You then invoke the FaxServer's CreateDoc method to create a fax document object. The FaxDoc object has a (huge) number of properties to specify more about the recipient and document than any sane person would imagine, but the two main ones are the FileName and FaxNumber. Once you've set those (along with any others you want) you invoke its Send method to send that document to that fax number.

    I last played with this a few years ago, so I'm probably skipping a few things. Mostly I remember that it seemed strange that the FaxServer created a blank FaxDoc that you filled in and then asked to send itself, and that there was a lot of documentation covering "stuff" that initially seemed like it would be necessary, but turned out to be completely irrelevant, at least for what I was doing (and in retrospect, probably usually would be).