Aphrodisiacs and the ruling on taking them
Question

                told me that that is not haraam because they are not drugs and so long as they do no harm there is nothing wrong with taking them. In fact the doctor told me: There is nothing wrong with taking them because they do not harm the body, so long as a single dose is not more than 20 mg. 
What is the Islamic ruling on that?.
Praise be to Allah.Firstly: 
Discussion on the harmful effects of aphrodisiacs 
Doctors are able to treat most cases of impotency and they have discovered a number of useful ways and means including the following: 
Treatment by means of aphrodisiac medicines that are taken by mouth in the form of pills, such as Viagra and so on
Treatment by means of topical injections that dilate blood vessels
Treatment by means of suppositories inserted through the urethra.
Treatment by means of surgically inserted devices; this is only resorted to if the previous methods fail. 
Some of these remedies are harmful and have side-effects, especially aphrodisiacs that are taken by mouth and artificial devices. 
All aphrodisiac medicines that are taken by mouth in the form of pills may cause headaches, nosebleeds, stomach pain, indigestion, sensitivity to light, lower back pain and muscle pain. 
Taking these medicines without consulting a doctor when one is already suffering from vascular diseases may expose the individual to harm because many of these patients take nitrite medicines, which interacts strongly with Viagra, as Viagra prevents this medicine from being absorbed by the patient’s body; this leads to a severe drop in blood pressure which may in turn lead to death. 
Secondly: 
Ruling on taking aphrodisiacs 
Aphrodisiacs are used in two cases: 
-1- 
Where there is a need for it because of old age or to treat sickness. In that case using it is permissible and is acceptable according to sharee‘ah, because Islam enjoins the Muslim to seek medical treatment and pursue means of treating disease. For example the Messenger of Allah (blessings and peace of Allah be upon him) said: “Seek medical treatment for Allah, may He be glorified and exalted, has not created any disease but He has also created the remedy for it apart from one disease, namely old age.” Narrated and classed as saheeh by al-Tirmidhi; also narrated by Abu Dawood and Ibn Maajah. 
It may also be recommended according to sharee‘ah, such as if it will lead to having children, which is enjoined in the texts of sharee‘ah, including the verse in which Allah, may He be exalted, says (interpretation of the meaning): “And now have sexual relations with them and seek that which Allah has ordained for you (offspring)” [al-Baqarah 2:187]. And the Messenger of Allah (blessings and peace of Allah be upon him) said: “Marry the one who is loving and fertile, for I will be proud of your great numbers before the nations.” Narrated by Abu Dawood and al-Nasaa’i; it is saheeh. 
But it is essential to pay attention to the guidelines set out by specialists who are the experts in this field. Among the guidelines that they have mentioned are the following: 
1.The patient who is suffering from impotence should not take these aphrodisiacs until after consulting a trustworthy, specialist doctor.
2.He should not rely completely on these aphrodisiacs to the extent that the body cannot function properly without them
3.He should not go to excess in taking them because doing so may lead to harm that threatens his life.
-2-
The second case is using aphrodisiacs to attain more pleasure and so on. The ruling in this case depends on the consequences of using these aphrodisiacs unnecessarily. Specialists have stated that use of aphrodisiacs by healthy persons for the purpose of increased pleasure may lead to lasting harm. Medical studies have proven that consumption of aphrodisiacs by healthy individuals has the opposite effect in the long term, because these medicines give the body energy that may last for several hours, but the body soon pays the price for that energy by falling into exhaustion. It is known that that which leads to harm that outweighs any benefit, or leads only to harm (with no benefit) is not permitted by the texts of sharee‘ah and Islamic principles. 
It says in al-Maraaqi: 
In sharee‘ah, everything that leads to harm is forbidden. 
Summarised from a Master’s thesis entitled al-Nawaazil fil Ashribah (p. 237-240 by Shaykh Zayn al-‘Aabideen ibn Shaykh ibn Azwayn, supervised by Shaykh Sa‘d ibn Turki al-Khathlaan. 
See also the answer to question no. 79072 
For more information on the ruling on saying “what is the shar‘i view?” Please see the answer to question no. 72841 
And Allah knows best.