Faxing using ASP.NET

G

Guest

Guest
Archived from groups: microsoft.public.windowsxp.print_fax (More info?)

Hi There,

I am trying to fax a document from an asp.net page and I am getting an
Error message saying Access denied.

Here is my function that I am using.

Sub SendFax(ByVal strFilePath As String, byVal strPhone As String)
Dim objFaxServer As New FAXCOMLib.FaxServer
Dim objFaxDocument As FAXCOMLib.FaxDoc
Dim JobID As Long

objFaxServer = CreateObject("Faxserver.Faxserver")
objFaxServer.Connect("") <-- access denied message here
objFaxDocument = objFaxServer.CreateDocument(strFilePath)

objFaxDocument.FaxNumber = strPhone

' Send the Fax
JobID = objFaxDocument.Send()

objFaxDocument = Nothing
objFaxServer = Nothing
End Sub


I have tried giving IUSR and IWAM accounts access to the shared fax
printer and the c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary
ASP.NET Files directories but still no luck.

I have a Windows 2003 Server with fax sharing installed.

Does anyone have the solution to this problem ?

Regards

David
 
G

Guest

Guest
Archived from groups: microsoft.public.windowsxp.print_fax (More info?)

Hey David

In your connect objFaxServer.Connect("computername");
try that, and let me know if that fails.

-Ravi Singh
 

suresh

Distinguished
Jun 24, 2004
19
0
18,510
Archived from groups: microsoft.public.windowsxp.print_fax (More info?)

Hi,
Iam using the following code in ASP.NET application to send fax.

1) Dim objFaxServer As New FAXCOMLib.FaxServer

2) objFaxServer = CreateObject("Faxserver.Faxserver")
3) objFaxServer.Connect(Environment.MachineName)

But recieving the following error while connecting to fax server.(In 3rd line)

Error: "System.Runtime.InteropServices.COMException: Unspecified error"


Thanks in Advance.
 
G

Guest

Guest
Archived from groups: microsoft.public.windowsxp.print_fax (More info?)

I guess you are using this on a machine running Windows 2000 and is trying
to connect to the local Fax server. Please confirm this. Also, make sure
that the local fax service is up and running [you can do "net start fax" at
the command line to start the fax service]

If the above is fine, please catch the COMException [please look into MSDN
for details on this] and please supply the error code and the message
associated with the exception. That will help us identify the issue.
--
Archan Das

Microsoft Printing, Imaging and Fax Team

This posting is provided "AS IS" with no warranties, and confers no rights.

Please do not send email directly to this alias. This alias is for newsgroup
purposes only.

"Suresh" <Suresh@discussions.microsoft.com> wrote in message
news:01AE05B8-3761-41BB-ABAB-DBBA2DCF50D1@microsoft.com...
> Hi,
> Iam using the following code in ASP.NET application to send fax.
>
> 1) Dim objFaxServer As New FAXCOMLib.FaxServer
>
> 2) objFaxServer = CreateObject("Faxserver.Faxserver")
> 3) objFaxServer.Connect(Environment.MachineName)
>
> But recieving the following error while connecting to fax server.(In 3rd
line)
>
> Error: "System.Runtime.InteropServices.COMException: Unspecified error"
>
>
> Thanks in Advance.
>
>
 
G

Guest

Guest
Archived from groups: microsoft.public.windowsxp.print_fax (More info?)

Hey Suresh

A possible place where your problem might lie I think is that you might
not have enough perms for the command Enviorment.MachineName try
replacing that with "MyComputer" in quotes.
Hope this helps

-Ravi Singh
 

suresh

Distinguished
Jun 24, 2004
19
0
18,510
Archived from groups: microsoft.public.windowsxp.print_fax (More info?)

I checked "net start Fax" and Fax service is running without any problems. I
tried the connect method using several options (like NULL,empty
string,mycomputer,computername) but went in vain.
 
G

Guest

Guest
Archived from groups: microsoft.public.windowsxp.print_fax (More info?)

Hello Suresh

As Archan mentions in his post quoted below

>If the above is fine, please catch the COMException [please look into
MSDN
>for details on this] and please supply the error code and the message
>associated with the exception. That will help us identify the issue.

Your best bet would be to give the error code that would help us step
through the problem.
 

suresh

Distinguished
Jun 24, 2004
19
0
18,510
Archived from groups: microsoft.public.windowsxp.print_fax (More info?)

I'm here with error details.

Exception Details: System.Runtime.InteropServices.COMException: Unspecified
error

[COMException (0x80004005): Unspecified error]
FAXCOMLib.FaxServerClass.Connect(String ServerName) +0