xp_sendmail query in subject line

  • Using xp_sendmail, is it possible to put a query into the subject line.

    I know how to put a query into the text of the email but we have a case where a query in the subject would identify how high a priority the email actually is.

     

    Thanks

     

    David Weil

  • Do you want the results of the query in the subject line ?

  • Yes

    thanks

  • DECLARE @Subject varchar(4000)

    SELECT @Subject = MyField FROM MyTable

    EXEC xp_sendmail 'me@mydomain.com', @Subject

    Andy

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

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