MailGetField

The MailGetField function sets a pointer to a specified field in the header string.

Syntax

LPWSTR MailGetField (MailMsg* pmm, LPWSTR szName, BOOL fGetName);

At a Glance

Header file: Msgstore.h
Platforms: H/PC
Versions: 1.0 and later

Parameters

pmm
Pointer to the mail message containing the header being searched.
szName
Pointer to a string containing the name field that will be searched for in the message header (for example, "To", "From", "Cc", "Subject"). The process of searching the header for a match with the field name is not case-sensitive. Therefore, this parameter can be any combination of uppercase and lowercase letters.
fGetName
Which field of the entry is retrieved. It can be one of the following values:
TRUE
The return value points to the name field.
FALSE
The return value points to the value field — that is, the field that follows the name field.

Return Values

This function returns a pointer to the requested field, as specified by the fGetName parameter.

Remarks

The MailGetField function searches the header (that is, the pwcHeaders field) of the MailMsg structure in memory. Before calling MailGetField, the message must be retrieved from the message store by calling MailGet, MailFirst, or MailNext.

The pwcHeaders member of the MailMsg structure points to the message's header string. The header consists of entries made up of two fields: a name, and an associated value. The name fields are separated from the value fields by a NULL character, and the entries are separated from each other by a NULL character. The header string is terminated with two consecutive NULL characters.

See Also

MailHeaderLen, MailSetField, MailGet, MailFirst, MailNext