Hello and thank you for allowing me the opportunity to assist you.
Question: “How can I get a court order for text messages? My husband has been cheating on me and I want to get a copy of the text messages”
Answer: Assuming the content of the text messages is even retrievable (i.e. they may be lost forever once deleted), you would need a court order to get them from the phone company. In order to get such a court order, there has to be a lawsuit of some kind (i.e. a divorce in your case), and the text messages would need to be relevant to the case (and they would if they can help prove adultery – assuming adultery is being alleged).
So, you first need to file for divorce, and then request an order from the judge directed to the phone company that compels the phone company to disclose the text messages.
Have I satisfactorily addressed your concerns? If not, then please feel free to ask for clarification.
DISCLAIMER: Please understand that the complexities of most legal problems cannot be adequately addressed in this setting, and that I am only licensed to practice law in the state of Maryland. Accordingly, you acknowledge (1) that we have not formed an attorney-client relationship, and (2) that my post is general information only and not specific legal advice.