Of all the people who profess that they know how to do men good, do you mean to say that these are the only ones who not only do them no good, but positively corrupt those who are entrusted to them, and in return for this disservice have the face to demand money? Indeed, I cannot believe you; for I know of a single man, Protagoras, who made more out of his craft than the illustrious Pheidias, who created such noble works, or any ten other statuaries. How could that A mender of old shoes, or patcher up of clothes, who made the shoes or clothes worse than he received them, could not have remained thirty days undetected, and would very soon have starved; whereas during more than forty years, Protagoras was corrupting all Hellas, and sending his disciples from him worse than he received them, and he was never found out. For, if I am not mistaken,-he was about seventy years old at his death, forty of which were spent in the practice of his profession; and during all that time he had a good reputation, which to this day he retains: and not only Protagoras, but many others are well spoken of; some who lived before him, and others who are still living. Now, when you say that they deceived and corrupted the youth, are they to be supposed to have corrupted them consciously or unconsciously? Can those who were deemed by many to be the wisest men of Hellas have been out of their minds? (emphasis added by Phil)
That's Socrates from Plato's Meno, a piece about the nature of virtue and whether it can be learned. Socrates is responding to a claim by Anytus, one of the future accusers of Socrates, about the Sophists, professional teachers in 5th century Greece. Anytus claims the Sophists did nothing but corrupt those they served.
The quote underscores the importance of reputation but it also underscores Adam Smith's correct claim that people motivated by self-interest have an incentive to provide quality goods and services to people. Those who produce shoddy products quickly find that customers quickly become customers of competitors that provide good products. This self-interest serves the overall good of society.