In Islam, the relations between the spouses should be based on tranquility, love and mercy. Allah says, (And among His Signs is this, that He created for you mates from among yourselves, that you may dwell in tranquility with them, and He has put love and mercy between your (hearts): verily in that are Signs for those who reflect.) (Ar-Rum 30: 21)
Thus, it is no wonder that Islam prohibits a wife to have an affair with another man other than her husband as this is a real betrayal to the marriage bond and marital life.
Sheikh Ahmad Kutty, a senior lecturer and Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states the following: Definitely it is haram (forbidden) for her to do so just as it would be haram for you to do so with another female. We are only allowed to talk with a non-mahram in business-like settings and in a business-like manner.

The Prophet (peace and blessings be upon him) has warned us against such actions when he stated that “The eyes commit adultery, the tongue commits adultery, the hands commit adultery, the feet commit adultery and then the private parts confirm it or deny it.” (Reported by Ahmad Ibn Hanbal)
Therefore, we are ordered to refrain from all such activities that may inadvertently lead to fornication. This is why Allah said: (Do not go even near fornication) (Al-Israa’ 17:32). It is clear from the above verse that Allah prohibited going near fornication, and he did not say, ‘do not commit fornication.’
Therefore, the wife must stop doing that with non-maharem men if she is keen to preserve her honor and religion.
May Allah help us all to remain steadfast on the path of purity, chastity, and faith. Ameen.