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. So, we have to stay away from anything that may lead us to do haram.