xp_readmail

  • Hi All,

    Hope someone can help me out of this little problem.  I have an email where the legnth of the body is roughly 7000 characters.  When i am trying to get the message body using the xp_readmail procedure it only ever returns 4000 characters.  Anyone know why?  i will post by code below...

    DECLARE @status int,

    @message_id varchar(255),

    @originator varchar(255),

    @cc_list varchar(255),

    @msgsubject varchar(255),

    @query  varchar(8000),

    @date datetime

    --finds mail ID for first unopen mail.

    beginloop:

    EXEC @status = xp_findnextmsg

    @unread_only ='TRUE',

    @msg_id = @message_id OUTPUT

    print @message_id

    if @message_id is null

    begin

    print 'No Messages'

    select * from johntest where status = 0

    End

    else

    Begin

    --uses mail ID to extract parameters

    EXEC @status = xp_readmail @msg_id = @message_id,

      @originator = @originator OUTPUT,

      @cc_list = @cc_list OUTPUT,

      @subject =   @msgsubject OUTPUT,

      @message = @query OUTPUT,

      @peek = 'TRUE',

      @suppress_attach = 'TRUE',

      @date_received = @date OUTPUT

    select len(@query)

  • If you try to read the message in sections (by specifying length_in_bytes and length_in_bytes) can you read the full message?

    Andras


    Andras Belokosztolszki, MCPD, PhD
    GoldenGate Software

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

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