All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and messenger.
We implore Allaah to alleviate your hardship, relieve your distress, preserve you religiosity and honor, and unite you with your husband. Verily, Allaah is near and answers people’s supplications.
We advise you to adhere to patience and to supplicate Allaah, The Exalted. Indeed, He answers the supplications of the distressed and relieves hardship. Allaah, The Exalted, says (what means): {Is He [not best] who responds to the desperate one when he calls upon Him and removes evil and makes you inheritors of the earth? Is there a deity with Allaah? Little do you remember.} [Quran 27:62]
If what you experienced – i.e. sexual arousal and discharge of sexual fluid - was involuntary, which means that this did not happen by your own free will, you bear no sin for that. Allaah, The Exalted, says (what means): {And there is no blame upon you for that in which you have erred but [only for] what your hearts intended. And ever is Allaah Forgiving and Merciful.} [Quran 33:5]
Ibn ‘Abbaas related that the Prophet, sallallaahu ‘alayhi wa sallam, said: “Verily, Allaah has pardoned my nation for what they do by mistake, out of forgetfulness, and what they do under coercion.” [Ibn Maajah]
If the sexual fluid was discharged from you involuntarily, your fast was not invalidated by that.
As for seeing a wet dream, one bears no sin for that and his fasting is not invalidated because the deeds of a person while sleeping are not recorded (i.e. he will not be held accountable before Allaah for what he does or says during sleep).
‘Aa’ishah narrated that the Prophet, sallallaahu ‘alayhi wa sallam, said: “The pen has been lifted (i.e. the actions are not recorded) for three: the sleeping person until he awakens, a child until he reaches puberty, and an insane person until he regains sanity or comes to his senses.” [Abu Daawood, An-Nasaa’i, and Ibn Maajah]
Allaah Knows best.