Couples are permitted to resort to methods that are capable of assisting their reproduction as long as the sperm and the egg come from the husband and wife who are still legally married, and the methods used do not cause harm to the husband, the wife, or the child.
The Islamic Religious Council of Singapore states the following: The principle in Islam is that any method that can assist reproduction and encourage pregnancy is allowable, as long as the sperm and egg come from the husband and wife who are still legally married, and the method does not bring harm to either partner or the future child.
If the marriage has already been dissolved, or one partner has passed away, the sperm and egg cannot be mixed together, even though they came from the time when both were legally married. This is to avoid confusion, misunderstanding, and legal problems in the future.