An Endotoxin is a toxin that is contained within a cell and only released when the cell membrane is destroyed. These toxins are commonly found in gram-negative bacteria, and are held inside because of the bacteria's impermeable membrane. When large amounts of these bacteria are destroyed, a large amount of that specific toxin may be released into the surrounding environment, causing infection and other problems. The two most common endotoxins are lipopolysaccharide and lipooligosaccharide, both of which occur in gram-negative bacteria and are instrumental in helping the bacteria cause infection (Wikipedia).
An Exotoxin is a type of toxin produced by a cell for the express purpose of releasing into the surrounding environment. These toxins are created to attack and kill other cells, and are extremely harmful to their surrounding environment, whether it is a body or other habitat. One good defense against exotoxins is heat, which is why one common immune response is fever; the fever heats up the body's temperature, making it difficult for the exotoxins to survive and function. Exotoxins are often combated by B Cells in the lymphatic system; their antigens are identified and remembered for stronger future defenses.