We will make use of faxcom.dll component to send fax. This file is available in c:\windows\system32 (in Win XP) or c:\winnt\system32 (Win 2000). Add the reference to this component from the VS IDE.
Now it is available in VS IDE's intellisense.
If the file is not available, you can download this file from here and register the component by using regsvr32 utility.
Now we are done with setting up the library. Let’s get into the code.
Here is the code snippet.
FAXCOMLib.FaxServerClass fsc = new FAXCOMLib.FaxServerClass();
fsc.Connect("targetFax");
object obj = fsc.CreateDocument("FileNameToBeSent");
FAXCOMLib.FaxDocClass faxDoc = (FAXCOMLib.FaxDocClass)obj;
faxDoc.FaxNumber = "RecipientFaxNo";
faxDoc.RecipientName = "Destination";
int result = faxDoc.Send();
MessageBox.Show(result.ToString());
fsc.Disconnect();
Note: The computer which sends the fax should have installed fax enabled modem.
I hope you will find this useful.