First, we would like to stress that anal intercourse with one’s wife is a major sin, whether it occurs at the time of menstruation or not. The Prophet (peace and blessings be upon Him) cursed the one who does this. He is reported to have said, “Cursed is the one who approaches his wife in her rectum.” (Reported by Imam Ahmad, 2/479)
The Prophet (peace and blessings be upon Him) is also reported to have said: “The one who has intercourse with a menstruating woman, or with a woman in her rectum, or who goes to a fortune-teller, has disbelieved in what was revealed to Muhammad.” (Reported by At-Tirmidhi, no. 1/243; see also Saheeh al-Jami’, 5918).
Responding to the question, Dr. `Ali Jum`ah, professor of Principles of Islamic jurisprudence at Al-Azhar University, states the following:
“To have anal sex with one’s wife is unlawful in Islam because Allah, Exalted and Glorified be He says: “Your women are a tilth for you (to cultivate) so go to your tilth as ye will.” (Al-Baqrah: 223)

Anus is not a place of cultivation. The Messenger of Allah (peace and blessings be upon him) is reported to have said: “The one who has intercourse with a menstruating woman, or with a woman in her rectum, or who goes to a fortune-teller, has disbelieved in what was revealed to Muhammad.”

The four schools of Islamic jurisprudence and other Muslim jurists have unanimously agreed that anal sex is haram or unlawful. The wife should abstain from responding to her husband’s demand to have anal sex, and she will not be considered disobedient in that case. Still, she has the right to seek divorce as long as he insists on having anal sex, or harm her on account of her refusal. However, the marriage is still considered valid, and this act is no more than a forbidden practice done in the framework of a valid contract.”