Why do people insist on making any kind of an exit statement? If management is actually concerned, they'll let you know and ask to have a talk with you. HR may do an exit interview. If there are improvements you think could be made, then make some recommendations without venom.
If you're leaving, just shut up and leave. Making some sort of exit statement whether the leave is due to something benign or not is never required and usually bad form. You certainly don't have to undermine the company by saying that you're leaving for greener pastures or more money. If you feel an absolutely overwhelming compulsion to send out the typical blanket email and there's any negativity in it, don't send it. If you're leaving under pleasant conditions (you enjoyed your job and the people you work with), then keep it simple, positive, and generic.
For example, "As some of you may already know, I've accepted a position at a different company and today is my last day. I just wanted to say that it's been a real pleasure working for and with you good folks and that I've learned a whole lot during my service here. Thank all of you for your camaraderie and your friendship over the years. It's been a real pleasure."
Like I said, if something like the above isn't how you actually feel, don't send an exit email. Just go. It's too late to teach pigs to fly.
Shifting gears a bit, I've worked for a couple of companies that will give you a military escort off the premises about an hour after you let management know you are resigning because a lot of people "turn poison" right after that. First, expect that. Second, if the company does require you to continue working for 2 weeks or 4 weeks (like Gail suggested), don't "turn poison". Instead, concentrate on doing the best you can to 1) help the people you're leaving behind to fill the gap you're creating and 2) at least be proud of yourself that you still did the absolute best you could without setting anyone on fire and leave on the best terms possible even if you hate the company and or the people you've had to work with/for.
Heh... in other words, be a professional about it all. 🙂