I wanted to know if it’s valid to end a motaa marriage by message ?

Yes as long as you are certain of it taking place. As in you are certain it is the guy that you are doing it with and not some random or automated message.