Click here to Skip to main content
11,920,394 members (52,521 online)
Click here to Skip to main content
Add your own
alternative version


53 bookmarked

ISAPI Extension for sending faxes

, 26 Mar 2002
Rate this:
Please Sign up or sign in to vote.
An article on sending faxes through a Web page
<!-- Download Links -->


Windows 2000/XP offers two possibilities to send faxes programmatically, either by a COM-Object (faxcom.dll) or by an API (winfax.dll). The COM object also can be used in script languages like JScript, however, it isn't so flexible as the API. Through the API on the other hand you receive control over the sending process during sending. To be able to send faxes by a web page, I have written an ISAPI extension using the Fax-API.

To use the fax API you must use the corresponding header files and libraries from the Microsoft Platform SDK. You can download the Platform SDK under free of charge.

Installation and configuration

To be able to use the ISAPI-Extension, the IIS and Microsoft Fax service must of course be installed and working faultlessly. Before you use the ISAPI-Extension you must test faxing by sending a document e.g. over Wordpad to the fax printer.

After it, create a new web folder and out of it an application by using the IIS-Manager. The "execution rights" of the application must be set to "script and executable files ", the application protection to "low (IIS process)":

 Through "Authentication methods" the anonymous access must be prevented: 

After it, you copy the ISAPI-Extension (FaxISAPI.DLL) and the necessary ASP files (default.asp, progress.asp and ready.asp) into the web folder. Now start the browser and enter the address to the web folder (e.g. "http://localhost/fax") and send a fax through the web page.


The code of the FaxISAPI.DLL consists of three .cpp files. The file extension.cpp contains the functions for the ISAPI-Extension, upload.cpp contains the C++ class for the Upload, fax.cpp contains the C++ class for initializing the fax server and for sending faxes.

To inform the client about status information of the Upload and fax process, the ISAPI-DLL writes into a status file (this status file will be created in "c:\ winnt\temp" and the name of it corresponds to the Session ID + ".log").
The ASP file progress.asp is refreshed by the browser every second and the progress.asp reads the Status on the server from the status file.

The default.asp contains the HTML form to get the fax number from the user. The fax number then is passed to choosefile.asp. The file choosefile.asp contains the HTML form for the choice of the faxing file and calls the FaxISAPI.DLL at a "Submit" and opens simultaneously a new browser window by Javascript with the progress.asp.

Upload of the file to be faxed

The CUpload class contains the methods for the Upload of exactly one file to a web server. The class writes the number of bytes written to the status file and also the length of the file. This status information is used by progress.asp to show a progress bar. The uploaded file is stored intermediately in the folder "c:\winnt\temp".

Faxing the uploaded file

CFax contains the methods for the Initializing/Deinitialising (Init, DeInit) of the fax service and the method for sending Fax documents (send). The method Init of the ISAPI.DLL is called when loading the DLL the first time, DeInit when unloading the DLL. The real sending process of the fax document is implemented in CFax::Send. The ISAPI-DLL finish its work and sends a Redirect to ready.asp to the browser after the fax was sent. Ready.asp then gives the user information about whether the fax could be successfully sent.


Through the fax API you can access all essential events of the fax service.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Sönke Cordts
Web Developer
Germany Germany
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralMy vote of 1 Pin
behzad200015-Oct-13 21:20
memberbehzad200015-Oct-13 21:20 
Questionthe web not run. only refresh Pin
hoacksl28-Apr-12 23:52
memberhoacksl28-Apr-12 23:52 
Questionwhat am I missing? Pin
zepp24-May-06 18:35
memberzepp24-May-06 18:35 
GeneralWorks fine just one time Pin
Eric-7722-May-06 2:01
memberEric-7722-May-06 2:01 
GeneralCan't get it to work. Pin
supz22-May-06 1:00
membersupz22-May-06 1:00 
GeneralRe: Can't get it to work. Pin
supz22-May-06 2:03
membersupz22-May-06 2:03 
GeneralRe: Can't get it to work. Pin
supz8-Jan-07 20:34
membersupz8-Jan-07 20:34 
Generalpossible error in CUploadFile Pin
bartm10-May-06 1:48
memberbartm10-May-06 1:48 
GeneralErreur Interne Pin
fabfoot27-Apr-06 5:12
memberfabfoot27-Apr-06 5:12 
fatehh14-Jul-05 3:56
memberfatehh14-Jul-05 3:56 
Mohit Raj31-Jul-05 19:24
memberMohit Raj31-Jul-05 19:24 
GeneralAbout fax project Pin
krish2k59-Apr-05 1:02
memberkrish2k59-Apr-05 1:02 
GeneralRe: About fax project Pin
Mohit Raj31-Jul-05 19:16
memberMohit Raj31-Jul-05 19:16 
GeneralSending Multiple Fax (2) Pin
alberto_mecho26-Nov-04 6:26
memberalberto_mecho26-Nov-04 6:26 
GeneralSending multiple fax Pin
alberto_mecho26-Nov-04 2:49
memberalberto_mecho26-Nov-04 2:49 
GeneralRectification note Pin
alberto_mecho26-Nov-04 4:29
memberalberto_mecho26-Nov-04 4:29 
Questionpre-requisites? Pin
nsmalwankar20-Oct-04 12:14
membernsmalwankar20-Oct-04 12:14 
AnswerRe: pre-requisites? Pin
Mohit Raj31-Jul-05 19:19
memberMohit Raj31-Jul-05 19:19 
Generalerror in sending fax Pin
hi_hemant141-Jun-04 4:02
memberhi_hemant141-Jun-04 4:02 
GeneralFaxes are &quot;too light&quot; Pin
Neil Katalino21-Apr-04 3:32
memberNeil Katalino21-Apr-04 3:32 
GeneralCan't Run Pin
garfieldlau13-Apr-04 21:30
membergarfieldlau13-Apr-04 21:30 
GeneralRe: Can't Run Pin
Mohit Raj30-Sep-04 19:44
memberMohit Raj30-Sep-04 19:44 
GeneralRe: Can't Run Pin
nsmalwankar20-Oct-04 11:12
membernsmalwankar20-Oct-04 11:12 
QuestionHow dees this DLL handle a multi-user enviroment? Pin 19:57 19:57 
Generalerror Pin
can prox3-Dec-03 2:04
membercan prox3-Dec-03 2:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.151120.1 | Last Updated 27 Mar 2002
Article Copyright 2002 by Sönke Cordts
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid