Click here to Skip to main content
12,406,649 members (54,976 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 20:20
memberbehzad200015-Oct-13 20:20 
Questionthe web not run. only refresh Pin
hoacksl28-Apr-12 22:52
memberhoacksl28-Apr-12 22:52 
Questionwhat am I missing? Pin
zepp24-May-06 17:35
memberzepp24-May-06 17:35 
GeneralWorks fine just one time Pin
Eric-7722-May-06 1:01
memberEric-7722-May-06 1:01 
GeneralCan't get it to work. Pin
supz22-May-06 0:00
membersupz22-May-06 0:00 
GeneralRe: Can't get it to work. Pin
supz22-May-06 1:03
membersupz22-May-06 1:03 
GeneralRe: Can't get it to work. Pin
supz8-Jan-07 19:34
membersupz8-Jan-07 19:34 
Generalpossible error in CUploadFile Pin
bartm10-May-06 0:48
memberbartm10-May-06 0:48 
GeneralErreur Interne Pin
fabfoot27-Apr-06 4:12
memberfabfoot27-Apr-06 4:12 
fatehh14-Jul-05 2:56
memberfatehh14-Jul-05 2:56 
Mohit Raj31-Jul-05 18:24
memberMohit Raj31-Jul-05 18:24 
GeneralAbout fax project Pin
krish2k59-Apr-05 0:02
memberkrish2k59-Apr-05 0:02 
GeneralRe: About fax project Pin
Mohit Raj31-Jul-05 18:16
memberMohit Raj31-Jul-05 18:16 
GeneralSending Multiple Fax (2) Pin
alberto_mecho26-Nov-04 5:26
memberalberto_mecho26-Nov-04 5:26 
GeneralSending multiple fax Pin
alberto_mecho26-Nov-04 1:49
memberalberto_mecho26-Nov-04 1:49 
GeneralRectification note Pin
alberto_mecho26-Nov-04 3:29
memberalberto_mecho26-Nov-04 3:29 
Questionpre-requisites? Pin
nsmalwankar20-Oct-04 11:14
membernsmalwankar20-Oct-04 11:14 
AnswerRe: pre-requisites? Pin
Mohit Raj31-Jul-05 18:19
memberMohit Raj31-Jul-05 18:19 
Generalerror in sending fax Pin
hi_hemant141-Jun-04 3:02
memberhi_hemant141-Jun-04 3:02 
GeneralFaxes are &quot;too light&quot; Pin
Neil Katalino21-Apr-04 2:32
memberNeil Katalino21-Apr-04 2:32 
GeneralCan't Run Pin
garfieldlau13-Apr-04 20:30
membergarfieldlau13-Apr-04 20:30 
GeneralRe: Can't Run Pin
Mohit Raj30-Sep-04 18:44
memberMohit Raj30-Sep-04 18:44 
GeneralRe: Can't Run Pin
nsmalwankar20-Oct-04 10:12
membernsmalwankar20-Oct-04 10:12 
QuestionHow dees this DLL handle a multi-user enviroment? Pin 18:57 18:57 
Generalerror Pin
can prox3-Dec-03 1:04
membercan prox3-Dec-03 1:04 
GeneralDoesn't create the sessionid.log file in winnt\temp folder Pin
Alok Dash24-Sep-03 0:59
memberAlok Dash24-Sep-03 0:59 
GeneralRe: Doesn't create the sessionid.log file in winnt\temp folder Pin
Sönke Cordts24-Sep-03 1:02
memberSönke Cordts24-Sep-03 1:02 
Generaljava fax Pin
nowmedia22-Jul-03 0:21
membernowmedia22-Jul-03 0:21 
GeneralRe: java fax Pin
liuxiao121724-Nov-03 18:22
memberliuxiao121724-Nov-03 18:22 
GeneralISAPI in C# Pin
Arash Sabet21-Jul-03 5:41
memberArash Sabet21-Jul-03 5:41 
GeneralSolutions Pin
Anonymous14-Jun-03 0:25
sussAnonymous14-Jun-03 0:25 
Generalcan't build the dll Pin
josephwang30@yahoo.com11-Jun-03 0:38
memberjosephwang30@yahoo.com11-Jun-03 0:38 
GeneralRe: can't build the dll Pin
[ELNINO]6-Apr-04 1:17
member[ELNINO]6-Apr-04 1:17 
GeneralRe: can't build the dll Pin
nsmalwankar29-Oct-04 9:21
membernsmalwankar29-Oct-04 9:21 
GeneralError Pin
Ciel.Zanato8-Jun-03 1:53
memberCiel.Zanato8-Jun-03 1:53 
GeneralHelp needed Pin
Qayyum Asma20-May-03 17:59
memberQayyum Asma20-May-03 17:59 
QuestionWorked examples? Pin
Butter0822-Jan-03 4:40
memberButter0822-Jan-03 4:40 
GeneralFaxSendDocument and HTML format Pin
Mukesh27-Nov-02 19:38
memberMukesh27-Nov-02 19:38 
GeneralRe: FaxSendDocument and HTML format Pin
LukCastles17-Dec-02 2:28
memberLukCastles17-Dec-02 2:28 
Generalwhy,help me Pin
ansonding23-Oct-02 23:45
sussansonding23-Oct-02 23:45 
GeneralRe: why,help me Pin
aspprog27-Dec-02 17:15
memberaspprog27-Dec-02 17:15 
Generalplease help me Pin
chiranjeevi23-Oct-02 16:36
memberchiranjeevi23-Oct-02 16:36 
GeneralInternal Server Error Pin
Kendo6523-Oct-02 14:20
sussKendo6523-Oct-02 14:20 
GeneralRe: Internal Server Error Pin
Erkang Zheng4-Dec-03 8:08
memberErkang Zheng4-Dec-03 8:08 
GeneralRe: Internal Server Error Pin
vampiresoft6-Dec-03 11:53
membervampiresoft6-Dec-03 11:53 
GeneralRe: Internal Server Error Pin
fucking hostile7-May-04 2:23
memberfucking hostile7-May-04 2:23 
GeneralRe: Internal Server Error Pin
fabfoot27-Apr-06 3:47
memberfabfoot27-Apr-06 3:47 
GeneralWinFax lib/.h file Pin
Anonymous10-Oct-02 1:11
sussAnonymous10-Oct-02 1:11 
GeneralRe: WinFax lib/.h file Pin
Sönke Cordts10-Oct-02 2:00
memberSönke Cordts10-Oct-02 2:00 
GeneralError: data is invalid Pin
Anonymous19-Sep-02 6:46
sussAnonymous19-Sep-02 6:46 

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.160730.1 | Last Updated 27 Mar 2002
Article Copyright 2002 by Sönke Cordts
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid