I also ruined a couple of thermos by doing that. Milk would filter through the gasket. You should rinse it thoroughly with a chlorine dilution afterwards, but even then, rubber don't take well [rotten] milk.
In the meantime, heat the milk separately, then add it.