In a very bad or unpleasant manner. He was treated rottenly by his so-called friends.
In a morally corrupt or dishonest way. The politician acted rottenly, betraying the trust of the public.
Used as an intensifier meaning extremely or very. The soup was rottenly hot, so I had to wait before eating.