Divorce by writing, if it is clearly stated such as saying You are divorced (anti taaliq)' is a real divorce and there is no need to have the intention of divorce.
See the answer to question no. 72291
If the wife claims that her husband divorced her and he denies it, then his words count unless she brings proof that the divorce has taken place. This is from the point of view of rulings and verdicts, and the matter rests with Allah, may He be exalted, Who can see what is in his heart. If he knows that he issued a divorce, then he did not take her back during the iddah or do a new marriage contract after the iddah, then his intimacy with her is zina and is haraam.
If you kept his message in which he clearly stated a divorce, this is sufficient to prove that divorce has taken place. If this was the first or second divorce, then he may take you back so long as you were still in iddah. The iddah of a woman who menstruates is three menstrual cycles; for a woman who does not menstruate it is three months. The iddah of a pregnant woman lasts until she gives birth.
If the iddah has ended and he has not taken you back, then he is not permissible for you except with a new marriage contract that fulfils the conditions of having two witnesses and a wali (woman's guardian).
And Allah knows best.
Reproduced from Islam QA