static HTTP_IO_RESULT HTTPPostEmail();
This function sends an e-mail message using the SMTP client and optionally encrypts the connection to the SMTP server using SSL. It demonstrates the use of the SMTP client, waiting for asynchronous processes in an HTTP callback, and how to send e-mail attachments using the stack.
Messages with attachments are sent using multipart/mixed MIME encoding, which has three sections. The first has no headers, and is only to be displayed by old clients that cannot interpret the MIME format. (The overwhelming majority of these clients have been obseleted, but the so-called "ignored" section is still used.) The second has a few headers to indicate that it is the main body of the message in plain- text encoding. The third section has headers indicating an attached file, along with its name and type. All sections are separated by a boundary string, which cannot appear anywhere else in the message.
None
Return Values |
Description |
HTTP_IO_DONE |
the message has been sent |
HTTP_IO_WAITING |
the function is waiting for the SMTP process to complete |
HTTP_IO_NEED_DATA |
data needed by this function has not yet arrived |