Mix the sugar, cocoa, flour, and salt together in a heavy medium saucepan. Add 1/4 cup of the milk and stir to a smooth mixture. Add the remaining milk and the vanilla; blend well.
Place the saucepan over medium-high heat and bring to a boil, stirring frequently. As soon as the sauce comes to a boil, reduce the heat to the lowest and simmer for 5 minutes, stirring frequently.
Let the sauce cool; pour it into a jar or container and store it, covered, in the refrigerator for up to 2 weeks.