Wa `alaykum As-Salamu wa Rahmatullahi wa Barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
Dear brother in Islam, thanks a lot for your question which reflects your care to have a clear view of the teachings of Islam. Allah commands Muslims to refer to people of knowledge to get themselves well-acquainted with the teachings of Islam as well as all aspects of life.
In the first place, we would like to stress that in vitro fertilization is permissible as long as the semen and ovum are from a husband and wife who are legally married and the fertilization takes place during their marriage, not after divorce or the death of the husband.
In his response to your question, Sheikh Ahmad Kutty, a senior lecturer and Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states:
IVF is permissible in Islam only on condition that both sperm and egg involved in the process originate from a man and a woman who are married to each other. To introduce an egg or sperm from a third person to the equation is akin to sharing the marriage bed with someone else. It is therefore considered no different from zina (adultery) in Islam. A child born through such a procedure is born of zina in Islam.
Since it is undoubtedly reprehensible and utterly sinful, no Muslim should ever entertain such a possibility for conceiving a child. A Muslim should accept what Allah has chosen for him or her. To accept Allah as a Sovereign Lord and Creator means to believe in His will and ultimate wisdom. Allah says: (To Allah belongs the Sovereignty of the heavens and the earth. He creates whatever He wills. He grants daughters to whom He wills, and sons to whom He wills; or He gives both sons and daughters to whom He wills and makes barren whom He wills. Indeed He is Knowing, Able) (Ash-Shura 42: 49-50).
So continue to pray to Allah to grant you offspring while resorting to all available treatments you can possibly afford. If it is Allah’s will, He will certainly grant your prayer; if on the other hand, should He not choose to do so, simply accept the will of the All-Wise, and All-Knowing.
May Allah make us all contented with His decree, and grant us all the true joy of submitting to His inscrutable will. Ameen.
Excerpted, with slight modifications, from: www.muslims.ca
You can also read:
In Vitro Fertilization: Islamic View
Artificial Insemination from an Islamic Perspective
Does Islam Allow “Surrogate Motherhood”?