01 - Preheat oven to 350°F. Grease a 9-inch pie dish or springform pan with butter or cooking spray.
02 - Cook spaghetti in salted boiling water until al dente according to package directions. Drain well and set aside.
03 - In a skillet, melt the butter over medium heat. Sauté onion and bell pepper until softened, about 4–5 minutes. Add garlic and cook 1 minute more. Remove from heat.
04 - In a large bowl, whisk together eggs, milk, Italian herbs, salt, pepper, and red pepper flakes until well combined.
05 - Add cooked spaghetti, sautéed vegetables, mozzarella, and half of the Parmesan to the egg mixture. Toss gently to combine thoroughly.
06 - Pour the mixture into the prepared pie dish. Sprinkle remaining Parmesan cheese evenly over the top.
07 - Bake for 35–40 minutes until the center is completely set and the top is golden brown. A knife inserted in the center should come out clean.
08 - Let the pie cool for 10 minutes before slicing to allow it to set. Garnish with chopped fresh basil or parsley and serve warm.