Butter or oil a 3-quart gratin dish or casserole pan.
Slice the leeks. Mince the green chilies. Shave the corn from the cobs. Chop the parsley and basil.
Cube the bread. If it isn’t dry, then lightly dry it by heating it in a 200F oven on a cookie sheet for 10-20 minutes.
Heat the oil in a wide skillet over medium-high heat. Saute the leeks for a few minutes until softened, then add the green chilies and saute for one minute. Add the corn, and paprika or chile. Cook until the corn is heated through, about 4 minutes.
Season with 1/2 teaspoon salt and stir in the parsley and basil.
Whisk the eggs and milk with 1/2 teaspoon salt in a large mixing bowl. Add the bread cubes and stir gently to mix. Add the corn mixture and grated cheese.
Transfer the mixture to the prepared dish.
Bake until puffed and browned, about 45 minutes.