Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Wash the shirts separate from other colored clothes, on hot. Also wear an undershirt to prevent sweat/deodorant from coming in contact with the shirt, creating stains.
 
Soak in water mixed with OxyClean for a few hours before washing in hot water. Avoid drying in direct sunlight, which can yellow the fabric and cause it to deteriorate.
 
We use this stuff. Works well if it's available where you are 🙂

I use "this stuff" too, and it works quite well for stains. I always carry one in my suitcase when travelling abroad for any period of time.

I use that all the time on my white work shirts and of course a really hot wash. Sadly for white shirts you have to say "sod the environment" and wash as hot as you can.

Agreed. As other posters have already said, whites need very, very, hot water, and whites need to be washed separately (no other colours at all should be in with them), and, sometimes, a rather strong (bleach based) detergent is also needed.
 
Whiter "white" shirts

Don't do the dry cleaner thing! That is definitely one thing that makes white shirts that "grayish" color. They use a chemical on your white shirts that changes the new white color to a dingier color forever! And...while the ease of not having to launder (or iron) them yourself is nice, they won't look the same once they go through your local dry cleaners process!
The majority rules below too! "If you want something done right, do it yourself"!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.