• Did you resolve why you get the names of your variables and not the values? When you set @message_body, you shouldn't quote your variable names because they're treated as string literals. Here's the line I'm referring to with the quotes removed.

    SET @MESSAGE_BODY = @CURRENTTIME + @CURRENTUSER + @SERVERNAME

    + @ERROR_MESSAGE + @ERROR_SEVERITY + @ERROR_LINE + @ERROR_STATE