Sprinkle the cheeses into a greased 13x9 baking dish.
In a large skillet, heat the butter over medium-high heat. Then saute the mushrooms, green onions, and red pepper until tender.
Stir in the ham, and spoon the mixture over the cheeses.
In a large bowl, whisk together the eggs, salt, pepper, milk and flour. Pour this mixture over the ham mixture.
Refrigerate, covered over night.
Preheat the oven to 350°.
Remove the casserole from the refrigerator while the oven heats.
Bake, uncovered, until a knife that is inserted into the center comes out clean about 35 to 45 minutes.
Let the casserole stand for about 5 minutes before serving.