Absolutely nothing wrong with checking a partners phone, if you have suspicions. My first H and I were having problems. He got drunk and passed out. I looked at his phone and found texts between him and my BEST friend discussing the sex they'd had. When I confronted them both, they still denied it. I would never have gotten the truth, had I not snooped, and I'm not sorry.
Okay, so my thoughts on this :
He shouldn't be thinking of his Ex, if he's happily married to you.
He CERTAINLY shouldn't be texting an old flame - I mean, why would you, if not to start something?
How would he feel if you were reaching out to Ex boyfriends?
This line : ”I thought I told you not to contact me and I’ll contact you instead…because it’ll make it hard for me to forget about you” makes no sense if they haven't spoken for over 7 years, because
A) no one would even remember a conversation from 7 years ago
B) no one would still not be over someone, if the last contact was 7 years ago
C) no one, with an inch of pride, would admit they're still not over someone from 2017!
FWIW, I was with my first H for 20 years, and we have 2 adult children, and we have zero contact. ZERO.
I would check his texts, e-mails, whatsapp, messenger - you name it. You deserve the truth. In the meantime, I would go very cold on him, move unto spare room if you have one, make him realise he's in trouble.