You may think you're communicating friendly appreciation when you send a complementary message about someone to their manager with them cc-ed, but the message that you're also sending is that you're the sort of person who thinks it's okay to talk to people's managers about them, and you run a very real risk of losing your peers' trust.