Deletes a message from the SQL Server inbox. This procedure is used by the sp_processmail system stored procedure to process mail in the SQL Server inbox.
xp_deletemail [@msg_id = ] msg_id
where
This extended stored procedure returns a successful (0) or failed (1) status. Any failure except an invalid parameter is logged to the Windows NT application event log.
This example deletes the message ID as supplied from xp_findnextmsg. In this example, the value from xp_findnextmsg is placed in a local variable named @message_id.
xp_deletemail @message_id
Execute permission defaults to the system administrator, who can grant permission to other users.
sp_processmail | xp_sendmail |
xp_findnextmsg | xp_startmail |
xp_readmail | xp_stopmail |