I have been in this situation and would now answer that I would completely end the friendship.
I spoke with him regularly as I also did all of my other (make and female) friends, although he was probably in my top 3 closest friends. I knew his wife didn't particularly like me although she didn't really particularly like anyone so I didn't pay it much attention.
Most of our messages were causal but we knew each other for 8 years and knew about each others families, big life events etc (as did our other friends to be clear) and would offer each other emotional support too.
My own DH was very aware of the level of our friendship, the content of messages etc and had no issue with it.
Near the end I did sort of get the vibe that my friends wife was unhappy but I just wrote it off - she was controlling, it wasn't my problem, I wasn't doing anything wrong and stopping talking to him would make me seem guilty. All I'm doing is chatting to my friend and their relationship stuff is nothing to do with me. It's not my choice to make for him. He can deal with it himself.
Evidently, once unable to get her husband to stop being friends with me she decided to bring out the big guns.
She went through four years of our chats on his phone and cut and pasted together (out of context) loads of different messages that she thought proved our friendship inappropriate.
Examples of this included him telling me he was thinking of and "sending me love" when I found out it was likely I couldn't have children. And me telling him he's a great friend to me and that I'm here for him any time he needs to chat with a love heart when he had a cancer scare. These messages are the kinds of messages both of us sent to our same-sex friends too at times.
There seems to be this general vibe that opposite sex friendships are only ok if there's absolutely no emotional closeness at all but in which case I'd say they're not really friendships. People tell even acquaintances things when they talk, never mind their actual friends. I can't imagine regularly spending time with someone for almost a decade and never sharing anything personal or bonding over a shared history or similar things happening in life.
There was one instance he complained about his wife to me and I stuck up for her and shut him down.
Anyway back to the story. His wife made a collage (yes a digital COLLAGE) of all these "inappropriate messages" over the years stuck together out of context to imply that we were having a constant back and forth love-in. They were stripped of all context and embarrassing and private messages were included in there. They were sent to everyone we knew.
I was humiliated. To give an example, I admitted to him at one point that I'd gotten really drunk after I'd had a really bad day and called in sick for work the next day as I was so hungover. I was almost never off sick so while I did feel guilty, it wasn't exactly any more of a crime than people who pull the odd sicky. I never did it again. She sent this to my boss.
After that our mutual friends all got to have a good nosey and decide whose side they were on and got to read all the juicy stuff while we (I mostly) tried to explain.
Unfortunately the friends wife was the one to come off most favourably and most people sympathised with her. Many wanted to "not choose sides" but it became really messy like we were having to share custody of this group of adults. And pretty much all of them made it clear they agreed with her and understood why she was unhappy. Several said they didn't think we were in any way having an affair or anything but that her feelings were understandable and so in turn her actions were too.
You could have made similar out of context collages of all of my friends chats which would have looked exactly the same but there you go. It never comes across the same with M/F friendships which is why it's impossible to really have a genuine friendship with the opposite sex as it's simply not socially acceptable to speak in the same way you would your female friends.
Unfortunately by taking her side they really took his and her side as they stayed together and I was the "other woman" who I guess had spent the last almost decade playing a very long and very badly executed seduction game. I assume he was simply the poor naive innocent man who was seduced.
So no. I wouldn't fancy that again. And while I think what she did was insane I also kind of blame him. He kept dismissing her feelings repeatedly. He wanted to have his cake and eat it. He wanted to stay with his wife and ignore her displeasure at our friendship.
I wrote her off as controlling but that was his problem to deal with and he should have. He could have left if he didn't like being in a controlling relationship. Or if he didn't want to leave, he could have stopped the friendship.
Looking back it's likely he did confide in me (and his other friends) more than he did her and it's likely he did have more in common and more similar interests with me (and his other friends) than with her. It was an odd relationship and an odd match and they never seemed to enjoy being around each other.
I just wish instead of putting all that blame on her I'd have stopped to actually judge him for the relationship he continually chose to be in. And made clear to him that I'm not continuing being friends in any capacity unless his wife is ok with it.
I wouldn't do that again.