All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
Indeed, Islam preserves relations between individuals in a way that suits the human nature. The contact between a man and a woman is prohibited except under the wing of legal marriage. If there is any necessity of talking to the opposite sex, it should be within the limits of politeness and good manners, Allah Says (what means): {And when you ask [his wives] for something, ask them from behind a partition. That is purer for your hearts and their hearts.} [Quran 33:53]
In another verse Allah Says (what means): {O wives of the Prophet, you are not like anyone among women. If you fear Allah, then do not be soft in speech [to men], lest he in whose heart is disease should covet, but speak with appropriate speech.} [Quran 33:32]
The conversation may be by (tongue) speaking, or by writing, or by gesturing. The main thing is conveying one’s feelings to another using any method of communication.
An Arab poet said: “No doubt that talking is in the heart, and the tongue is nothing but an indication of what is in the heart.”
A Muslim should not address any opposite sex. This is a way of Satan to mislead the people. Allah Says (what means): {O you who have believed, do not follow the footsteps of Satan. And whoever follows the footsteps of Satan - indeed, he enjoins immorality and wrongdoing.} [Quran 24:21]
Regarding the correspondence between opposite sexes, the details are as below:
If the correspondence was on the request of a person who was in need to increase his/her knowledge about Islam or wants to know Muslims’ affairs, etc., then this kind of correspondence would be permitted. If there is no necessity or one finds any alternate for this purpose, then one should not address the opposite sex. As it is known, most young men’s and women’s correspondences these days concentrate on sex and its related subjects. You may find that a girl is in contact with many young men, and a guy is in connection with a number of girls; everyone is destroying his intellect, thought, and efforts in this aimless correspondence. Probably they might discuss subjects which we feel shy to mention here. In this cause, they are committing sins, and Satan leads them to destroy their precious time and efforts on trifles. The safest way for faith and religion is to keep away from all these things. There is no lack of lawful ways.
For more benefit on men chatting with women on the Internet, please refer to Fataawa 119025, 87959, 85359, 84874, 84079, 81671, 82217, and 81757.
Allah knows best.