How to send Fax Using C# ??

Hi

I have config the Fax service in Windows 2003 . but

How to send Fax Using C#

And thanks with my best regarding
Fraas



Answer this question

How to send Fax Using C# ??

  • csekhar

    Its difficult question


  • msmfl144

    Hi All,

    I used the following code and it worked fine when runing the web application from visual studio:

    doc = (FAXCOMLib.FaxDoc)server.CreateDocument(TheFile);

    doc.FaxNumber = faxnumber;

    doc.SenderFax = "765765765";

    doc.SenderName = senderName ;

    doc.SenderAddress = "test";

    doc.SenderCompany = "My Company";

    doc.RecipientName = recipientName;

    doc.DisplayName = displayName;

    response = doc.Send();

    return response.ToString();

    server.Disconnect();

    But when I tried it from Internet explorer, it gives me the following error:

    Operation timed out ..

    Any help

    Thanks


  • Tim Williams

  • jhmckin

    Can Any One Help me please
  • Ctrl A

  • cmmf11

    Hi,

    Does anyone know how to ONLY send the coverpage I don't want to send an attached document.

    I read in another forum to set FaxDoc.Filename to null - but this just raises an error -

    I have tried to set it to ="" as below

    FaxDoc faxDoc = (FaxDoc) faxServer.CreateDocument(@"C:\faxtest\TestDoc.txt");

    faxDoc.FileName="";

    This doesn't error - but it does not queue anything. (The code works perfectly without the filename="" line but sends a page 2 with the unwanted contect)

    the complete test code is as follows:

    FaxServer faxServer = new FaxServerClass();
    faxServer.Connect(
    null);

    FaxDoc faxDoc = (FaxDoc) faxServer.CreateDocument(@"C:\faxtest\TestDoc.txt");
    faxDoc.FileName="";

    faxDoc.SendCoverpage = 1;
    faxDoc.CoverpageName = @"C:\Fax\Personal Coverpages\Default.cov";
    faxDoc.CoverpageSubject ="Order placement";
    string bodyText = "This is a test" +Environment.NewLine ;
    bodyText += "list of products"+Environment.NewLine ;
    bodyText += "that should be on several lines";
    faxDoc.CoverpageNote = bodyText;
    faxDoc.RecipientName = "Test Recipient Name";
    faxDoc.FaxNumber = "01200000012";
    faxDoc.DisplayName = "TestFax";
    faxDoc.SenderName="Joe Bloggs";

    int iFaxJob = faxDoc.Send();
    faxServer.Disconnect();


  • How to send Fax Using C# ??