Please enable JavaScript to view this site.
EMLAPI can be utilised to send emails from your application programs. For example, you might decide to email urgent purchase orders to a supplier. Your reordering application would write purchase order details to the Cobwebb Email EMLAPI data queue APIEML#1, together with the relevant destination details.
Because Cobwebb Email utilises CPYSPLF/*PRTCTL format, you can easily incorporate printed output as the text of the fax using the QTXT Text Member Record.
The User (pos. 514 of QRCD) is used to check against the Cobwebb User Profile, if a User Profile record is found the following fields will be used if not previously completed:
Mandatory Authority
Maximum Priority
Mandatory Department
As the message is queued under the User name specified in the QRCD record, the user can be used to identify specific types of queue entry e.g. PURCHASING.
The procedure for writing to EMLAPI is as follows:
1.Allocate data queue APIEML#1 with an *EXCLRD lock state. This ensures integrity of data queue entries should another application attempt to write to the data queue at the same time. A CL primitive ALCDTAQE is provided for this purpose.
2.Send the appropriate data structures to the data queue. For each email there is a queue entry (QRCD), destination entries (QDST), a variable number of text entries, and a terminator (ENDQ).
3.Deallocate the EMLAPI data queue APIEML#1. CL primitive DLCDTAQE is provided for this purpose.
The formats for each type of data queue entry are:
•Queue record entry 'QRCD' - This is the first entry in the API set.
•Destination entries 'QDST' - Specifies destinations. Any number of QDST entries are allowed.
•Form Entry 'QFRM' - Specifies the member containing Form characters.
•Text line entries 'PRTCTL' Text for Email. First four characters of entry are *PRTCTL
•Text member record 'QTXT' - Specifies location of file and member if you have written the text to a file member.
•Terminator 'ENDQ' - Denotes the end of the API message.
#1 - This data queue name is held in the APIEML data area in library CPPD and could have been renamed.