Reads a mail message from the SQL Server mail inbox. This procedure supports an additional output parameter, @originator_address, that returns the resolved mail address of the originator of the mail message.
For additional syntax information for xp_readmail see the Microsoft SQL Server Transact-SQL Reference.
xp_readmail ([@msg_id = msg_id] [, @type = type [OUTPUT]] [, @peek = {'true' | 'false'}]
[, @suppress_attach = {'true' | 'false'}]
[, @originator = @sender OUTPUT]
[, @subject = @subject_line OUTPUT]
[, @message = @body_of_message OUTPUT]
[, @recipients = @recipient_list OUTPUT]
[, @cc_list = @cc_list OUTPUT]
[, @bcc_list = @bcc_list OUTPUT]
[, @date_received = @date OUTPUT]
[, @unread = {'true' | 'false'} OUTPUT]
[, @attachments = @temp_file_paths OUTPUT])
[, @skip_bytes = @bytes_to_skip OUTPUT]
[, @msg_length = @length_in_bytes OUTPUT]
[, @originator_address = @originator_address OUTPUT])
where