. . .and then said that she has not been a good wife. I told her that she was a great wife and not to doubt that.
Try not to over-praise her. A better answer would have been "We BOTH have done things that have been hurtful to each other. I think you'll find if you end all contact with these other men and come back and work on the marriage with me, I am ready to work on MY contributions to our marital problems, and I pray you will do the same."
Or something similar.
I know you're reeling, so best no decisions get made today. But you would be wise to tread VERY SLOWLY and CAREFULLY here, as your wife is clearly still wayward.