The WinMail API

The WinMail API is based on the front call technique as described in Front End Functions. All WinMail functions are grouped in the WinMail front end function module.

Table 1. WinMail front-end functions: General
Function name Description
CALL ui.Interface.frontCall("WinMail","Init",
  [], [id ] )
The Init function initializes the module.
CALL ui.Interface.frontCall("WinMail","Close",
  [id], [ result ] )
The Close function clears all information corresponding to a message, and frees the memory occupied by the message.
CALL ui.Interface.frontCall("WinMail","SetBody",
  [ id, body ], [ result ] )
The SetBody function sets the body of the mail.
CALL ui.Interface.frontCall("WinMail","SetSubject",
  [ id, subject ], [ result ] )
The SetSubject function sets the subject of the mail.
CALL ui.Interface.frontCall("WinMail","AddTo",
  [ id, name, address ], [ result ] )
The AddTo function adds a "To" addressee to the mail.
CALL ui.Interface.frontCall("WinMail","AddCC",
  [ id, name, address ], [ result ] )
The AddCC function adds a "CC" addressee to the mail.
CALL ui.Interface.frontCall("WinMail","AddBCC",
  [ id, name, address ], [ result ] )
The AddBCC function adds a "BCC" addressee to the mail.
CALL ui.Interface.frontCall("WinMail","AddAttachment",
  [ id, fileName], [ result ] )
The AddAttachment function adds a file as an attachment to the mail.
CALL ui.Interface.frontCall("WinMail","SendMailSMTP",
  [ id ], [result] )
The SendMailSMTP function sends the mail with the SMTP protocol.
CALL ui.Interface.frontCall("WinMail","SendMailMAPI",
  [ id ], [result] )
The SendMailMAPI function sends the mail with the MAPI protocol.
CALL ui.Interface.frontCall("WinMail","GetError",
  [ id ], [ result ] )
The GetError function gets a description of the last error that occurred.

The following functions are needed when you use SMTP server connections:

Table 2. WinMail front-end functions: SMTP-specific
Function name Description
CALL ui.Interface.frontCall("WinMail","SetSmtp",
 [ id, smtp:port ], [ result ] )
The SetSmtp function sets the SMTP server to be used.
CALL ui.Interface.frontCall("WinMail","SetFrom",
  [ id, name, address ], [ result ] )
The SetFrom function sets sender information.