"Mudd's Women"
The U.S.S. Enterprise pursues an unknown ship into an asteroid belt to save its crew before it's destroyed. The four people aboard are beamed on to the U.S.S. Enterprise; former nemesis Harry Mudd and three beautiful, sultry women: Ruth Bonaventure, Eve McHuron and Magda Kovacs. Mudd was transporting the three women to Ophiuchus VI to marry settlers there.
The Enterprise computers reveal that Mudd has been charged with a number of infractions of the law. In pursuit of Mudd's ship, the U.S.S. Enterprise has burned out its lithium crystals, which power the starship's engines, and Kirk orders them to proceed as quickly as possible to the nearest lithium mining planet. That planet is Rigel XII, which is inhabited by only three lithium miners.
Mudd manages to contact Ben Childress, the head miner, and make a deal with him. Mudd promises to deliver the three beautiful women to the lonely miners in exchange for lithium crystals and their help in escaping Kirk.
Upon reaching the planet, Eve tries to escape, having fallen for Kirk and not wanting to marry one of the miners, but Ben Childress brings her back. They discover that the women are using an extremely illegal Venus drug to make them beautiful and without which they become quite plain. By the time the fraud is discovered, Magda and Ruth are already married to the miners, to the satisfaction of all parties involved. Eve, who realizes that Kirk is married to his career and to his starship, settles for marrying Ben. Kirk gets the lithium crystals he needs for the U.S.S. Enterprise and Harry Mudd, on whom he has filed criminal charges.
http://www.startrek.com/startrek/view/series/TOS/episode/68668.html"I, Mudd"
Norman, an android pretending to be a member of the U.S.S. Enterprise crew, takes control of the starship and her crew, taking them to an unnamed planet where Kirk discovers an old nemesis ... Harry Mudd.
Fleeing from his most recent criminal exploit, Harry crash-landed on the planet, which is inhabited by androids designed by a long-extinct race. At first their desire to fulfill his every need seemed like paradise, but Harry soon realized that precluded him ever leaving the planet. So, sending Norman to capture the U.S.S. Enterprise, Mudd hoped to trade the starship's crew for his own freedom.
The androids, however, want to use the U.S.S. Enterprise as a vehicle to populate the universe, serving mankind and protecting them from themselves. Unwilling to spend their lives on the strange planet, waited on by machines, Kirk and company set about finding a way out. It is not without temptation, however.
Spock is shown what is supposedly the control center for all the androids ... a veritable electronics dream come true. McCoy is given an extensive lab, set up to do all the research he's ever wanted to do, while Scotty is shown the technical machine shop of his dreams. The androids offer Uhura eternal youth and beauty while Chekov contemplates a planet filled with beautiful young women.
In the end, however, the crew bands together in an attempt to thoroughly confuse and, ultimately, short-circuit them. Through a series of illogical and very funny antics, the U.S.S. Enterprise crew and Mudd cause Norman, the central control for all the androids, to have an electronic "nervous breakdown." Instead of granting Harry Mudd his freedom, Kirk leaves him on the planet with the remaining androids ... including many fashioned in the image of his shrewish wife, Stella, until he mends his ways.
http://www.startrek.com/startrek/view/series/TOS/episode/68742.html