Communication between a man and a woman should be of a goal that complies with enjoying what is good and preventing what is bad. Any communication or chatting between a man and a woman if not for a good cause, it will be a possibility for the cause of Shaytan (Satan). One should always ask him/herself why do I want to write to that man/woman or to talk to him/her? The answer will be helpful to take action. Keep far away from desire as Satan has very complicated approaches to insinuate you deviate from righteousness.

Dr. Muzammil Siddiqi, former President of the Islamic Society of North America,
states: “Internet chat is very similar to writing letters or talking to someone on phone. Actually it is a combination of both. Muslims have to observe the same rules as they observe in writing letters or making telephone calls. Islam does not permit love letters or intimate conversations between males and females who are not married to each other.
In all our correspondence and conversations we must observe haya’ or modesty. Boys and girls should not chat with each other just for socialization or passing time. It is haram (unlawful) for a non-mahram Muslim male and female to indulge in long conversations with each other unless it is necessary for education or for business. All conversation must be decent. The Qur’an reminds us again and again that all our words are recorded and we shall be held accountable for our words as well as our deeds on the Day of Judgment. (See Al-Ahzab 33:70; Qaf 50:18)
If one finds an interesting partner through Internet and there is a desire to know more about each other in order to get married, then one should involve one’s elders in this matter. Let the elders or some responsible friends do the investigation and negotiation on your behalf. Even when you want to talk to that person, it is good to have an elder present in this chat. In Islam the khalwah (privacy) with the non-mahram female (ajnabiyyah) is forbidden. Khalwah of course occurs when a male and a female are alone in person. But a virtual khalwah can also happen through conversation by phone or Internet. Just as men and women should not be alone with each other, in a similar way they should not be alone to talk to each other on phone or via Internet chat, especially if this conversation is about personal matters.”