For mentors and people you would like to stay in contact with, to use for references or simply as people you like to know, then of course you send a personalized email, and include your personal contact information. Tell them how they have helped (with specific details), and that you would like to keep in touch.
For others you have worked with but are just co-workers, a farewell email is nice, perhaps with contact information, perhaps not, depending on your preferences.
An out of office reply, indicating who is taking over your work, or who to contact about your work is a nice touch - it might work for a few days (or longer, depending on how fast your IT is). That lets people who don't interact with you much also know that you're gone.
A lot of this depends on the culture of your company. Some companies want to be in charge of this kind of communication. If you're at some place like that, the email or words in person to the people you want to keep in touch with are the most you might be able to do. If the company is especially draconian about it, take their contact information with you, and email them after the fact.