Has anyone had any luck to get faxing working with C# Here is the code I have
using System;
using FAXCOMLib;
namespace ConsoleApplication3
{
/// <summary>
/// Summary description for Class1.
/// </summary>
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");
}
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
Class1 objcsFax = new Class1();
objcsFax.FaxDocument("C:\\test.txt", "8067");
}
}
}

FAXCOMLib
Simon Heffer
anyway.. while searching i found sites that offer real good api`s for fax but they are for sale.. and i dont think you want it on money..
FassaBortolo
Faxing with XP and C#
A good site that provides his own .dll and shows more
Shows how to use the win2000 fax services
Try another look at that good site
Have luck!!
Mike Culver
james_cline_
1) I am idiot. I though I had show file extensions on so when I created the test.txt file I had an extra .txt on it, so the file name was really test.txt.txt and no test.txt.
2) The sample code is provided with a BMP as a test page. The application says invlaid data with it because it perfers text files over BMPs. I dont know why I am goin to look into more why it isnt enjoying BMPs.
dtlinker
Visit this site perhaps it can help you
http://www.dotnetspider.com/technology/kbpages/680.aspx
FAXCOMLib don’t exist in my framework
Help me .
JRQ
Hi may need you guys help out, how to return the status printing
How to use Dim status As FAXCOMLib.FaxStatus
Public FaxServer As Object Public FaxDoc As Object Public IND As Integer Public strStatus As StringTry
Dim fo As New OpenFileDialog()fo.Filter =
"Microsoft Word Document (*.doc)|*.doc| Adobe PDF (*.pdf)|*.pdf" If fo.ShowDialog = Windows.Forms.DialogResult.OK Then If fo.FileName = "" Then Exit Sub End If Else Exit Sub End If Dim fxsvr = New FAXCOMLib.FaxServer() Dim fxdoc = fxsvr.CreateDocument(fo.FileName) Dim status As FAXCOMLib.FaxStatus Dim fxport = New FAXCOMLib.FaxPort Tryfxsvr.Connect(
"nb-039") 'Machine Name Catch ex As ExceptionMessageBox.Show(ex.ToString())
End Tryfxdoc.FileName = fo.FileName
fxdoc.FaxNumber = InputBox(
"Fax Number:", "Enter Fax Number", -1, -1)fxdoc.RecipientName =
"" TryIND = fxdoc.Send()
'strStatus = status.Send()MsgBox(IND)
MsgBox(strStatus)
Catch ex As ExceptionMessageBox.Show(ex.ToString())
End Tryfxsvr.Disconnect()
Catch ex As ExceptionMessageBox.Show(ex.Message() & ControlChars.CrLf & ControlChars.CrLf & ex.ToString(),
"Error", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try