It is illegal to view someone's text messages without their consent, and it can lead to legal consequences.