Send Fax(in vb.net or c#)
how to send fax through web application ?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Farhan ShariffRank #2,004 · 725 reputationPosted Apr 16, 2014, 11:42 PM EDT
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");
}
}
}