<< Click to Display Table of Contents >>
ZfxSendSubmitFile
Send a single SUBMIT format file.
Syntax
ZFERR FAR ZfxSendSubmitFile( ZFSESSIONHANDLE hSession, char FAR *lpszSubmitFile, char FAR *lpszPrefix, char FAR *lpszBody)
Parameters
Parameter |
Description |
hSession |
API session handle, as returned by ZfxAPIInit call |
lpszSubmitFile |
Name of submit file (with path if not in current directory)lpszPrefix4 characters string giving the prefix to use when creating the control and data files. |
lpszBody |
Address of buffer of length ZFMSG_BODY_LEN+1 used to return the message body name if successfully submitted for sending. |
Description
This routine interprets the given SUBMIT format file, creating a CONTROL file and a DATA file (in ASCII text or Epson print format). It then calls the ZfxSendMsgEx function to submit these files for sending, and if successful returns the name of the message submitted. This is the simplest method of submitting a fax using the API.
Return value
The routine returns 0 if successful, otherwise one of the following:
ZFERR_NOT_INITIALISED
ZFERR_INVALID_PARAMETERS
ZFERR_FILE_OPEN_ERROR
ZFERR_FILE_ERROR
ZFERR_MESSAGE_ALREADY_EXISTS
ZFERR_SERVER_NOT_RUNNING
ZFERR_SUBMIT_FILE_INVALID
ZFERR_INFO_FILE_OPEN_ERROR
ZFERR_INFO_FILE_ERROR
ZFERR_INFO_FILE_INVALID
ZFERR_CANNOT_SUBMIT_REQUEST
Example
#include <stdio.h>
#include <zfapi.h>
...
if ((fp = fopen("XYZ.TMP", "w+b")) != NULL)
{
fputs("%%[MESSAGE]\r\n", fp);
fputs("From: Fred Smith\r\n", fp);
fputs("To: Jim Jones\r\n", fp);
fputs("Fax: 123 456 7890\r\n", fp);
fputs("%%[TEXT]\r\n", fp);
fputs("Hello Jim\r\n", fp);
fclose(fp);
Err = ZfxSendSubmitFile(hSession, "XYZ.TMP", "XSUB", szBody);
remove("XYZ.TMP");
}
if (Err == 0)
{
printf("Submitted message %s\n", szBody);
}
Related topics