Adding a reference to FAXCOMLib.dll (COM/Fax Services) in Windows XP provides access to the Windows Fax Service, which you can use to send a fax as follows:

FAXCOMLib.FaxServer faxServer = new FAXCOMLib.FaxServerClass();
if (FaxNumber != “”)
{
try
{
faxServer.Connect(MachineName);
faxServer.Retries = Retries;
faxServer.RetryDelay = RetryDelay;
FAXCOMLib.FaxDoc faxDoc = (FAXCOMLib.FaxDoc)faxServer.CreateDocument(FileName);
faxDoc.RecipientName = RecipientName;
faxDoc.FaxNumber = FaxNumber;
faxDoc.DisplayName = DocumentName;
int Response = faxDoc.Send();
success = true;
}
catch{}
finally
{
faxServer.Disconnect();
} // disconnect
} // send fax

Advertisements