In a medium bowl, whisk together the eggs and milk. Season with salt and pepper; and set aside. Butter one side of each slice of bread. Arrange half of the slices, buttered side down, in a single layer in a 9x13–inch baking pan. Top with half of the cheese, half of the ham, and half of the egg mixture. Add a second layer of bread, cheese, ham, and egg mixture. Cover and set aside in the refrigerator overnight. Preheat the oven to 350 degrees. Bake the casserole uncovered until the eggs are set, about 45 minutes.