The phone company has a log of every SMS you’ve ever sent.
...which is how I fought a texting-while-driving ticket in court. I won.