xp_readmail: attempting to access the resultset

  • I would like to read all the emails sent to the server and hold the messages along with the Originator in a table ready to forward them in a report to an administrator.

    I can get all the information using:

    EXEC @status = master.dbo.xp_readmail @msg_id = @msg_id,

    @message = @message OUTPUT,

    -- @skip_bytes = @skip_bytes OUTPUT,

    @msg_length = @msg_length OUTPUT

    and

    select '@status - ' = @status

    gives me the staus of the action.

    BUT.. I cannot then subsequently SELECT ORIGINATOR

    or

    SELECT @Message.

    Alternatively, is it possible to set the REPLY TO in an email using

    sp_sendmail?

    You can manually set this in an OUTLOOK message when creating it.

    HELP PLEASE

  • This was removed by the editor as SPAM

  • Not that I know of. I think we have a couple scripts that use CDO directly (mainly for cases where you're not running Exchange), might look at using one of those instead, that way you can access full functionality of the email system.

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply