Home |
Function xn_pop_RETR_next |
Function xn_pop_RETR_nextxn_pop_RETR_next retrieves the next part of a message from a POP3 server. typedef struct _mime_parse_info { int mime_type; char * mime_type_str; char * mime_field_ptr; int mime_field_len; } mime_parse_info; int xn_pop_RETR_next(pop_context * context, int num, mime_parse_info * parse_info); ParameterscontextPointer to the context of the current session. *context must have been initialized by xn_pop_client. num1 based index of the message to retrieve. parse_infoResults are written to this structure. return valueReturns 0 if successful, otherwise SOCKET_ERROR. If an error occurred, call xn_getlasterror and xn_geterror_string to return the error value. Section Error Codes further describes each error. Possible values for this function are:
This function must be called repeatedly until MSG_DONE is returned to retrieve all data of an email. The function retrieves the next part of a mail message where the possible parts are a MAIL header field, a MIME header field, and a text line of a mail or attachment body (at most 1000 bytes). The results of the part read are placed in *parse_info:
The following values may appear in parse_info->mime_type:
The same context structure must be passed between calls to this function. xn_pop_RETR_done must be called after the message has been retrieved. See demo program MailDemo for an example of using this function to parse an email.
|