• How would you add the subject to the message instead of getting the default of "SQL SERVER MESSAGE"?  I've tried adding the @subject = 'Test Subject' but get an error "Must pass parameter number 2 and subsequent parameters as '@name = value'. After the form '@name = value' has been used, all subsequent parameters must be passed in the form '@name = value'."  I then tried to add DECLARE @MYSUBJECT nvarchar (255) and then SET @MYSUBJECT = 'Test Subject' and then

    Exec Master.dbo.xp_sendmail  @mysubject ,@MyRecipients, @MyMessage  END END .  That gives an ODBC error 170 (42000)

    Any help is appreciated.