Admin Production ni-theme
Current Publication

InetPop3GetMessageInfo

LabWindows/CVI

InetPop3GetMessageInfo

int InetPop3GetMessageInfo (int POP3Handle, int messageIndex, int numberOfLines, char **from, char **to, char **cc, char **subject, char **body);

Purpose

Returns information in a POP3 email message.

Parameters

Input
Name Type Description
POP3Handle int A POP3 handle returned by the InetPop3Open function.
messageIndex int The zero–based index of a message on the POP3 server.
numberOfLines int The number of lines of the message body to retrieve. Pass –1 to retrieve the entire message body.

Note  Some POP3 servers do not support retrieving a specified number of lines. You must pass –1 for such POP3 servers.
Output
Name Type Description
from char * The value of the "From" field in the email message. Pass the address of a char* variable to hold the value. This function allocates memory for the value. You must discard this memory by calling the InetFreeMemory function. If you do not want this value, you can pass NULL for this parameter.
to char * The value of the "To" field in the email message. Pass the address of a char* variable to hold the value. This function allocates memory for the value. You must discard this memory by calling the InetFreeMemory function. If you do not want this value, you can pass NULL for this parameter.
cc char * The value of the "Cc" field in the email message. Pass the address of a char* variable to hold the value. This function allocates memory for the value. You must discard this memory by calling the InetFreeMemory function. If you do not want this value, you can pass NULL for this parameter.
subject char * The value of the "Subject" field in the email message. Pass the address of a char* variable to hold the value. This function allocates memory for the value. You must discard this memory by calling the InetFreeMemory function. If you do not want this value, you can pass NULL for this parameter.
body char * The body of the email message. Pass the address of a char* variable to hold the value. This function allocates memory for the value. You must discard this memory by calling the InetFreeMemory function. If you do not want this value, you can pass NULL for this parameter.

Note  Some email messages may contain attachments. This library does not support parsing and detaching attachments. The attachment data is returned along with the rest of the body. You can parse the body of the message for the attachments and decode the attachments if needed. Typically the attachment data is inserted as MIME blocks and encoded in base–64 and other formats.

Return Value

Name Type Description
result int Return value indicating whether the function was successful. A negative number indicates that an error occurred.

Additional Information

Library: Internet Library

Include file: cvintwrk.h

LabWindows/CVI compatibility: LabWindows/CVI 7.1 and later

Example

Refer to internet\pop3clnt\pop3clnt.cws for an example of using the InetPop3GetMessageInfo function.