• Hi

    I'm using sp_send_dbmail in below given format. If i execute first two lines it's showing "Mail Queued" and executing fine then i'm able to receive mail.

    1 EXEC msdb..sp_send_dbmail

    2 @recipients = 'kr@domain.com',

    3 @subject = 'Customer Information Updated',

    4 @query = 'select * from msdb.dbo.sysjobs',

    5 @attach_query_result_as_file =0,

    6 @query_attachment_filename = 'TEST.txt'

    But when i execute whole statements at a time. Receiving the following error.

    Msg 22050, Level 16, State 1, Line 0

    Error formatting query, probably invalid parameters

    Msg 14661, Level 16, State 1, Procedure sp_send_dbmail, Line 495

    Query execution failed: Msg 15404, Level 16, State 19, Server xxxxxxxxx, Line 1

    Could not obtain information about Windows NT group/user 'domain\username', error code 0x6e.

    Please help me here. How to resolve this.

    Regards

    Arjun


    Kindest Regards,

    arj