Windows NT only Retrieves the next message identifier from the Adaptive Server message inbox.
xp_findnextmsg @msg_id = @msg_id output [, type] [, unread_only = {true | false}]
on input, specifies the message identifier that immediately precedes the one you are trying to retrieve. Places the retrieved message identifier in the msg_id output parameter, which must be of type binary.
is the input message type based on the MAPI mail definition. The only supported message type is CMC:IPM. A NULL value or no value defaults to CMC:IPM.
if this parameter is set to true, xp_findnextmsg considers only unread messages. If this parameter is set to false, xp_findnextmsg considers all messages, both read and unread, when retrieving the next message identifier. The default is true.
Returns, in the @out_msg_id output variable, the message identifier of the next unread message after the message specified by the @out_msg_id:
xp_findnextmsg @msg_id = @out_msg_id output
Returns, in the @out_msg_id output variable, the message identifier of the next message after the message specified by the @out_msg_id. The message may be read or unread:
xp_findnextmsg @msg_id = @out_msg_id output, NULL, @unread_only = false
When xp_findnextmsg can find no more messages in the inbox, it returns a status of 1.
xp_deletemail and xp_readmail use the message identifier returned by xp_findnextmsg.
By default, only a System Administrator can execute xp_findnextmsg. A System Administrator can grant this permission to other users.