Search This Blog

Wednesday, January 20, 2010

send fax C#


Send fax C# using using FAXCOMLib;

public void SendFax(string DocumentName, string FileName, string RecipientName, string FaxNumber)
 {
         FAXCOMLib.FaxServer faxServer = new FAXCOMLib.FaxServerClass();
         faxServer.Connect(Environment.MachineName);
         FAXCOMLib.FaxDoc faxDoc = (FAXCOMLib.FaxDoc)faxServer.CreateDocument(FileName);
         faxDoc.RecipientName = RecipientName;
         faxDoc.FaxNumber = FaxNumber;
         faxDoc.Tsid = "Fax";
         faxDoc.DisplayName = DocumentName;
         int Response = faxDoc.Send();
          faxServer.Disconnect();
}