And sure, this could be an email (all of the same principles would apply), but a letter makes things official in every sense. It also gives you a prop to take along to the face_to_face meeting with your boss, when you let him or her know that you're leaving.
Or meet up with said colleagues at an industry event, because the world is awkwardly small. So it's in your best interest to make sure that your resignation letter is clear, concise, and polite. Here are some best practices you can follow to make your big exit a professional one.