Mr Gurinder Bharaj, from Southall in west London, was sentenced at Isleworth Crown Court in the city on Friday on eight counts of possession and supply of significant quantities of unauthorised and unlicensed medication.
Investigators from UK's Medicines and Healthcare products Regulatory Agency (MHRA) raided a property belonging to Mr Bharaj in Ealing, west London, where more than 100,000 individual doses of unlicensed erectile dysfunction medicines worth more than 30,000 pounds were uncovered and seized.
A smaller quantity of prescription medication was also seized.
"Selling unlicensed medicines is illegal and can pose a serious risk to health. The fact that a medicine is unauthorised means that it has not been subjected to the regulatory scrutiny and quality assurances required to get a license," said Head of Enforcement at MHRA, Alastair Jeffrey.
"These products can be dangerous as their contents are unknown and untested and the consequences for your health can be devastating. MHRA will continue to track down and prosecute those who put the public's health at risk," he said.
Following an initial hearing, Mr Bharaj pleaded guilty to all charges and was sentenced to 20 months' imprisonment with immediate effect and also ordered to pay 75 pounds as victim surcharge.
MHRA said it is running a #FakeMeds campaign to warn people against buying potentially dangerous or useless unlicensed medicines sold by illegal online suppliers.