Platform SDK: Fax Services |
A fax client application calls the FaxSendDocument function to queue a fax job that will transmit an outgoing fax transmission.
BOOL WINAPI FaxSendDocument( HANDLE FaxHandle, // handle to the fax server LPCTSTR FileName, // file with data to transmit PFAX_JOB_PARAM JobParams, // pointer to job information structure CONST FAX_COVERPAGE_INFO *CoverpageInfo OPTIONAL, // pointer to local cover page structure LPDWORD FaxJobId // fax job identifier );
This parameter can contain any valid local or remote file name. The file must be a properly registered file type, and the fax server must be able to access the file.
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError. GetLastError can return one of the following errors.
Error code | Description |
---|---|
ERROR_INVALID_PARAMETER | One or all of the FaxHandle, JobParams, or FileName parameters are NULL; or the call handle specified by the CallHandle member of the FAX_JOB_PARAM structure is invalid. |
ERROR_INVALID_FUNCTION | The FaxHandle parameter specifies a remote connection, but the CallHandle member of the FAX_JOB_PARAM structure is not NULL. |
ERROR_ACCESS_DENIED | Access is denied. FAX_JOB_SUBMIT access is required. |
ERROR_FILE_NOT_FOUND | The fax server cannot locate the file specified by the FileName or the CoverpageInfo parameter. |
ERROR_INVALID_DATA | The fax server cannot process the file specified by the FileName or the CoverpageInfo parameter. |
This function can also return a TAPI error code if you specify a CallHandle member to the FAX_JOB_PARAM structure.
Call the FaxCompleteJobParams function before calling the FaxSendDocument function. FaxCompleteJobParams is a utility function that fills in multiple members in the FAX_COVERPAGE_INFO and FAX_JOB_PARAM structures, with information such as the sender's name, the fax number, and optional billing code information.
The FaxSendDocument function executes asynchronously, and the function returns immediately. The fax server queues the job to send the fax transmission according to the details specified by the FAX_JOB_PARAM structure.
To send a fax document efficiently to multiple recipients, an application should call the FaxSendDocumentForBroadcast function, rather than calling FaxSendDocument multiple times. For more information, see Transmitting Faxes.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable with BackOffice Small Business Server.
Header: Declared in Winfax.h.
Library: Included as a resource in Winfax.dll.
Unicode: Implemented as Unicode and ANSI versions on all platforms.
Fax Service Client Application Programming Interface Overview, Fax Service Client API Functions, FaxConnectFaxServer, FaxCompleteJobParams, FaxSendDocumentForBroadcast, FAX_COVERPAGE_INFO, FAX_JOB_PARAM