Saute shallots and garlic in margarine in a large skillet over medium-high heat until tender. Add mushrooms, and cook until mushrooms are tender. Remove from heat, and set aside.
Combine milk, half-and-half, eggs, salt, and pepper in a large bowl. Remove crusts from bread, and reserve for another use. Cut bread slices into cubes, and add to milk mixture. Stir in mushroom mixture and cheese. Pour mixture into a greased 13- x 9- x 2-inch baking dish. Bake, uncovered, at 325° for 50 to 60 minutes or until lightly browned. Let stand 5 minutes. Cut into rectangles, and serve immediately.