01 - Preheat oven to 350°F. Grease a 9-inch pie dish or springform pan with butter or cooking spray.
02 - Boil spaghetti in salted water until al dente according to package directions. Drain thoroughly and set aside.
03 - Melt butter in a skillet over medium heat. Sauté onion and bell pepper for 4–5 minutes until softened. Add garlic and cook for 1 additional minute. Remove from heat.
04 - In a large mixing bowl, whisk together eggs, milk, Italian herbs, salt, black pepper, and red pepper flakes until well combined.
05 - Add cooked spaghetti, sautéed vegetables, mozzarella cheese, and half of the Parmesan to the egg mixture. Fold gently until evenly coated.
06 - Transfer the mixture to the prepared pie dish, spreading evenly. Sprinkle remaining Parmesan cheese over the top.
07 - Bake for 35–40 minutes until the center is firm and set, and the top is golden brown.
08 - Let cool for 10 minutes before slicing to allow the pie to set. Garnish with chopped fresh basil or parsley.