According to holy Islamic law, any form of interaction between a non-mahram man and woman, whether it is direct or indirect, is impermissible if it accompanied with lust, or there is fear of sin taking place. Also, it is clear that there are different levels of sin; some are worse than others. Having a relationship with a married woman is of the sins that entails a heavy punishment, but you should be very thankful of Allah (swt) that you were blessed with repenting in the beginning of this relationship before it got serious (it was only limited to speaking via phone and chatting).
Sin is like a foul-smelling swamp full of sewage; the more one sinks into it, the less he senses its smell, because he actually loses his sense of smell and can't tell that he is drowning anymore.
At the same time, anytime one makes a strong decision to return from this swamp, it is considered a victory. One who has decided to fight sin, needs to increase his ambitions for such, so that he can be victorious in the following stages of this struggle.
As for how to increase ambition and motivation, there are some methods that might be useful:
1- Paying attention to the disadvantages and harms of the sin
2- Paying attention to the high value of your own character
3- Paying attention to the magnanimous rank of Allah (swt) and that He has to be obeyed
4- Paying attention to the significance of struggling against sin and one’s illegitimate desires as a skill, and the pleasure of winning the struggle against the self.
In addition, you should try not to ever be alone anywhere and fill your free time with reading, sports, recitation and memorization of the Quran, worship, fasting, interacting with religious people, etc. This way, the chances of the sin being repeated will be less.
If you are single, try to get married as quick as possible, because fulfilling your sexual desires in a legitimate way might be the answer to the problem.
One of the most important points concerning this matter is for you not to lose hope in Allah’s (swt) mercy, and to trust in and ask Him for help. No matter how great the sin, one should never lose hope in Allah’s mercy.
The final point being that this sin isn't one of haqq al-nas and no one’s rights have been trampled, so all that is needed is true repentance and asking for forgiveness from Allah (swt) and not to return to the sin. Inshallah your shortcomings are forgiven.
According to holy Islamic law, any form of interaction between a non-mahram man and woman, whether it is direct or indirect, is impermissible if it accompanied with lust, or there is fear of sin taking place.
A glance at the fatwas of the maraje’ on questions about this issue clears everything up:
Question 1: When a non-mahram man and woman are speaking with each other, is there a difference between the dialogue being from far away or in person?
Answer (all of the maraje’): There is no difference in ruling and in both cases, if there is lust involved or fear of sin taking place, it is impermissible.
Question 2: What is the ruling on chatting with the opposite sex and speaking of normal things?
All of the maraje’: If there is fear of corruption and sin taking place, it is impermissible.
Question 3: Is it permissible for non-mahram men and women to greet each other?
All of the maraje’: If it is without lust and there is no fear of sin taking place, it is permissilble.
Question 4: What is the ruling on kidding with non-mahrams?
All of the maraje’: If it is with lust or there is fear of sin taking place, it is impermissible.
Question 5: Is having a warm relationship between a boy and girl while working or in gatherings problematic?
All of the maraje’: Friendship between boys and girls is impermissible, because there is a fear of sin taking place. As for their relationship at work, if it doesn’t lead to corruption and Islamic standards are observed, it is permissible.
Question 6: What is the ruling on writing to non-mahrams and speaking of sensual things via email with them?
The important point here is that sins differ in their degree, and among them, having a relationship with a married woman is one that entails a heavy punishment, but you should be grateful to Allah (swt) that your relationship was limited to only speaking over the phone and chatting and you kept it at that initial level and learned of your mistake and repented.
Sin is like a foul-smelling swamp in which if one remains in for a while, will lose his sense of smell and no longer be aware of the situation he is in, and as he sinks further into it, even more sickness and infection will take place for him, to the extent that he will lose all willpower and will no longer be able to save himself even if he wants to.
At the same time, whenever one decides to get out of and compensate for it and move towards salvation instead, he will still be considered a true winner who has prevented his own harm, paving the way for further victories.
What you should know is that repentance has several steps:
1- To make a decision not to commit the sin anymore
2- To refrain from the sin
3- To compensate for the sin one has committed before (to acquire virtues and do good deeds)
We congratulate you on beginning this process by making a strong decision not to repeat this sin. What needs to be done though is for you to quickly begin the second stage. In order to do so, you need to know why you have to put this sin aside, because as long you don’t have the proper motivation to do so, you probably won't succeed, because sins are tempting, as Imam Sadiq (as) says: “Heaven (actions that take one to heaven) is surrounded by hardship and Hell (actions that take one there) is surrounded by pleasures and desires”
Therefore, what is needed when one wants to refrain from a sin is to have a motive stronger than its temptation. If such a motive isn't in you, you need to obtain and strengthen it.
Here, we will list some methods that might help you achieve this goal:
1- To do some reading and research on the harms and disadvantages of sins and their outcomes; clearly if one is aware of the many short-term and long-term negative effects of sins, he will no longer commit them.
2- To pay attention to the significance of the character and status of oneself and that he is Allah's (swt) vicegerent on the earth, and that this status will be lost if he continues to sin.
3- To pay attention to Allah's (swt) high status and rank and His obedience, and that He is always present and watching; it is inappropriate to sin in His presence.
4- To pay attention to the fact that the Muslim youth is one who has impact on society and can have good effects on it if he himself is purified; not only can he save himself from sin, but can help others as well.
5- To remember that if Allah (swt) ever prohibits His servants from a certain act, it is to their own good, or else if the act was to be to their benefit, He certainly wouldn’t do so. Therefore if Allah (swt) prohibits us from fulfilling our sexual needs through other than marriage, and has threatened those who disobey Him with worldly and otherworldly punishment, there must have been some harm for us in it. One who loves Allah (swt) never disobeys Him, and if he doesn’t love Him (God forbid), he has to at least refrain from sin so that its harms don’t affect him.
6- To know that the pleasure taken in sin is only for a short period and passes quickly, but its outcomes are the opposite; no sane person would trade a short period of pleasure for lasting harm.
7- To remember that it isn't hard to sin; any person with the least willpower can do so. What is important and remarkable is for one to be able to struggle against himself and his satanic desires. Engaging in this struggle itself is hard and surely a victory for whosoever does so.
Keeping all of this in mind, you should try your best to stay away from sin-oriented environments, or environments that suit sinning. You should fill your leisure time with activities like sports, useful reading, recitation and memorization of the Quran, interaction with religiously devout individuals, fasting, etc. You need to keep telling yourself that you can do it; you can put this act aside.
If you are still single, you should try to get married as soon as possible; fulfilling your lust in a legitimate way may also be great help for solving this problem.
Dear friend! Fighting against sin and the allurement of Shaytan can be very hard, but at the same time it is very rewarding, and the pleasure one takes in being victorious in this field can in no way be compared with any other pleasure.
So, try your best to strengthen your motives for putting this harmful sin aside, and always remember that you have a very kind and strong supporter who has your back, which is none other than Allah (swt) Himself. In the case of us truly repenting from our sins, He will forgive them and help us in our struggles against them in ways that we can't imagine.
While being engaged in this struggle, never lose hope in Allah's (swt) grace and mercy and ask Him for help and trust in Him; don’t worry about the fact that you repeatedly break your repentance, instead, try again and again, utilizing the points mentioned above. We believe that you will eventually succeed, inshallah.
In any case, don’t lose any hope in Allah (swt) and also note that this sin is only haqqullah and not haqq al-nas and you haven't trampled anyone’s rights and there is no need for any compensation for anyone, all that matters is for you to truly repent to Allah (swt) and ask Him for forgiveness and not return to this sin, inshallah you are forgiven.
 Imam Khomeini, Istifta’at, vol. 3, question 52; Bahjat, Tawdih al-Masa’el, issue 1936; Makarem Shirazi, Istifta’at, vol. 1, question 819; Tabrizi, Istifta’at, issue 1622; Safi, Jame’ul-Ahkam, vol. 2, pg. 1673; Nouri, Istifta’at, vol. 2, pg. 656; Fazel, Jame’ul-Masa’el, vol. 1, question 1718; Khamenei, Ajwibah al-Istifta’at, question 1145; Al-Urwah al-Wuthqa, vol. 2, al-nikah, issue 3; Sistani, sistani.org (official website), questions 19 and 20; Wahid, office.
 Sistani, sistani.org (official website); Tabrizi, tabrizi.org (official website); the office of all of the maraje.
 Al-Urwah al-Wuthqa, vol. 2, al-nikah, issue 39 and 41.
 Ibid, issues 39 and 41; Fazel, Jame’ul-Masa’el, vol. 1, question 1720 and Khamenei, istifta’, question 782.
 Khamenei, istifta’, questions 651 and 779 and the offices of all the maraje’.
 Imam Khomeini, Istifta’at, vol. 3, miscellaneous questions, question 127; the offices of all the maraje’.
 Adopted from question 1044.
 “الجنة محفوفة بالمکاره و جهنم محفوفة باللذات و الشهوات” Wasa’ilul-Shia, vol. 15, pg. 309, section 42 (the section that speaks of refraining from haram desires and pleasures).
 فمن ابتغی وراء ذلک فاولئک هم العادون” Mu’minun:7.
 For further information, you can refer to: Masturbation and how to put it aside.
 Adopted from Question 370.