Click here to Skip to main content
15,915,160 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hii every one

I have a web application in which we have a requirement of sending fax
through the application.

I used the following code (given below) . It works fine from my local system. i.e.., when I connected FAX machine to my system and application is in my system.

But when I connect the FAX machine to my server with application installed on server , I get an error as Error HRESULT E_FAIL has been returned from a call to a COM component.

The web application is used in our LAN itself.So the user trying to send fax will be in network connection with the web server system to which FAX is connected.

Please help me out as what are the changes in code or configuration settings to be made to work.
Public Sub fnSendFax()

        Try
            Dim faxServer As New FAXCOMLib.FaxServer ' = New FAXCOMLib.FaxServerClass
            faxServer.Connect(Environment.MachineName)
         
            Dim faxDoc As FAXCOMLib.FaxDoc = CType(faxServer.CreateDocument(Server.MapPath("FaxPath//TestFax.txt")), FAXCOMLib.FaxDoc)
            faxDoc.RecipientName = "ReceiptName"
            faxDoc.FaxNumber = "3,123456"
            faxDoc.DisplayName = "Testing Fax"
            faxDoc.RecipientTitle = "Fax Send for Reports"
            faxDoc.SenderFax = "DOTNET"
            faxDoc.SenderName = "Fax Testing from ASP.NET(SSD)"
            Dim Response As Integer = faxDoc.Send
            faxServer.Disconnect()
        Catch Ex As Exception
            Response.Write(Ex.Message)
        End Try

    End Sub
Posted
Updated 9-Dec-10 0:07am
v4

Do you have a licence component also for the object you are using? It's possible that you may need to load that up and call a method to get that running.

Alternatively, there is a post here[^] with some good troubleshooting and side effects around using impersonation to get running properly with COM.

Cheers.
 
Share this answer
 
Go through the below link ..,

this may helps you

Here[^]
 
Share this answer
 
I have installed windows fax service in my server.
Gave all the permissions.
I Dont want to use licensing software to send fax.
So please suggest me a solution.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900