Send Fax(in vb.net or c#)
how to send fax through web application ?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Farhan ShariffPosted Apr 17, 2014, 3:42 AM
using FAXCOMLib;
namespace ConsoleApplication3
{
///
/// Summary description for Class1.
///
class Class1
{
public Class1()
{
}
public void FaxDocument(String TheFile, string faxnumber)
{
FAXCOMLib.FaxServer server = new FaxServerClass();
FAXCOMLib.FaxDoc doc = null;
int response = -11;
try
{
server.Connect(Environment.MachineName);
}
catch(Exception e)
{
System.Console.WriteLine("1"+e.Message);
}
try
{
doc = (FAXCOMLib.FaxDoc)server.CreateDocument(TheFile);
}
catch(Exception e)
{
System.Console.WriteLine("doc error"+e.Message);
}
try
{
doc.FaxNumber = faxnumber;
doc.RecipientName = "Test";
doc.DisplayName = "work";
}
catch(Exception e)
{
System.Console.WriteLine("assignments" + e.Message);
}
try
{
response = doc.Send();
}
catch(Exception e)
{
System.Console.WriteLine( response + e.Message);
}
try
{
server.Disconnect();
}
catch(Exception e)
{
System.Console.WriteLine("2"+e.Message);
}
System.Console.WriteLine("w00t");
}
///
/// The main entry point for the application.
///
[STAThread]
static void Main(string[] args)
{
Class1 objcsFax = new Class1();
objcsFax.FaxDocument("C:\\test.txt", "8067");
}
}
}