xp_findnextmsg returns the message identifier of the next message in the Adaptive Server inbox. Use the unread_only parameter to specify the messages for consideration:
true – to consider only unread messages.
false – to consider all messages.
You need the message identifier that is returned by xp_findnextmsg to pass to subsequent procedures that read and delete messages.