Grind the poppy seeds in a mill or coffee grinder.
Combine the milk, margarine, and sugar into a saucepan. Cook on low heat, stirring often, until the sugar dissolves.
Slowly whisk in eggs into the cooking mixture, continue stirring to prevent eggs from crumbling. Continue to cook and stir until the mixture begins to thicken; it should be similar to the condensed milk in texture.
Add the poppy seeds and stir well to blend. Remove from heat; cool before using. Store unused filling in the refrigerator for up to a week.