The TransportSend function sends a message — in the form of a MailMsg structure — using the transmit server.
BOOL TransportSend(HANDLE hService, MailMsg *MsgPtr);
Header file: | Smtp.h |
Platforms: | H/PC |
Windows CE versions: | 1.0 and later |
Returns TRUE if successful or FALSE otherwise. To get extended error information, call TransportError or TransportErrorMsg.
The TransportSend function must be implemented by the transport service provider in a DLL registered as a mail service. The Inbox application can load this DLL and call this function.
Because the sample transport service interfaces with the file system, the sample TransportSend involves creating and writing to a file (using CreateFile and WriteFile) that is located in the inbox. The MsgPtr structure contains the message header, body, and information that may be written to the file. In the sample SERVICE structure, the directory path serving as the inbox location is defined in the szMailDir field.
In order to display the progress status of the message transfer, the sample TransportSend routine also utilizes the CallBack routine that was passed to the TransportConnect function.
The sample service writes to the file system. If, for example, the service was for electronic mail, this routine would transfer the message using the transmit server for this service.