1. Bring water to a boil in a small saucepan and add the corn. Boil for 4-5 minutes until tender. Drain it. Cut the bacon in half and then into small squares. Put it in a pan and fry for about 5 minutes. Drain it to remove excess fat from the bacon. Add the olive oil to the pan and sauté the mushrooms. Drain them. Cut the ham into squares and finely chop the pepper. Put the corn, bacon, mushrooms, ham, and pepper in a bowl and mix. In another bowl, add the cheeses and mix well.
2. In a bowl, whisk the eggs and add the milk. Mix well. Butter 4 slices of sandwich bread and arrange them in a baking dish measuring 23x35cm. If necessary, cut them to cover the entire dish. Sprinkle with half of the meat mixture. Spread half of the cheeses on top, season with salt and pepper, and sprinkle with oregano. Pour over 1/3 of the egg-milk mixture. Arrange another layer of the sandwich bread slices, buttering them. Add the remaining meat mixture and the rest of the cheeses. Season with salt and pepper and sprinkle with oregano. Top with the grated mozzarella and pour over the remaining egg-milk mixture.
3. Cover with plastic wrap and place in the refrigerator for 2-3 hours, or preferably the night before, so the bread absorbs the liquids. Bake in a preheated oven at 180°C for 40 minutes.