Defamation refers to statements that unduly damage someone's reputation. Libel and slander are two forms of defamation, written and spoken respectively. Though defamation is not a crime, it is a civil wrong (called a "tort") for which a defamed person can sue. There are several elements to defamation that must be proven in order to win damages in court. Generally, the law attempts to balance the speaker's individual freedom of speech against the object's right to not be spoken of falsely.
Though it is required that a slanderous or libelous statement be published in order to qualify as defamation, this should not be interpreted in the literal, conventional sense. A defaming statement does not necessarily need to appear in a magazine or book, or even on TV or the internet, though all of these forms of media would count as publication. To be "published" the defamation merely has to be presented in a way that at least one third party can overhear it. A statement spoken loudly in public can meet the criterion of publication, as can statements made on leaflets, picket signs, speeches and in gossip.
You may have heard the saying, "It's not bragging if it's true." Well, if it's true, it's also not defamation. Sometimes the truth can hurt, and true statements can have the effect of damaging someone's reputation, even to the degree of creating real financial or other damages. But the party making the statement has not committed defamation if what is said is true. Defamation must be demonstrably false, which is where many claims fall short.
Defamation, in order to be established in court, must cause injury. If there is no injury, then there can be no damages, and there is therefore nothing a civil court can do to remedy the situation. Injury should be interpreted broadly, of course, as not being limited to physical harm. Any quantifiable loss related to the consequences of the statement, such as losing a job or losing social stature can be presented as injury to support a claim for damages. Note, however, that an individual who already has a poor reputation might not be deemed to have suffered significant injury for false statements consistent with their existing reputation, and therefore might not qualify for a significant award.
Certain types of speech are protected against claims of defamation, and are thus said to be privileged. The testimony of a witness at trial or in a sworn deposition is privileged in that it cannot constitute defamation even if demonstrably false. If a witness knowingly makes false testimony that is a crime called perjury. Other privileged speech includes that made by lawmakers in their official capacity in the legislative chamber or in official documents. The principle here is that lawmakers should not be constrained in their speech out of fear of prosecution. To constitute defamation, the statement at issue must not be privileged speech.
An individual accused of defamation can plead from among several affirmative defenses that, if recognized, defeat the claim of defamation. Among these are good faith reason to believe in the veracity of the statement, that the claimant consented to the dissemination (publication) of the statement, or lack of knowledge about the statement. Lack of knowledge protects, for example, the delivery boy delivering a newspaper with a defamatory statement in its contents. Some jurisdictions allow an assertion that the statement only reflected opinion rather than fact to defeat a claim of defamation, though the U.S. Supreme Court has ruled that this is not necessary.