I typically wait for one of the first stretches of really hot weather, and a day when the mood in the class is really upbeat and there isn't a lot of interpersonal tension. I make a big deal out of a student closing the door, so that we can have a quick talk - "just between us", and say something like:
You may have noticed that it's getting to be that type of weather when it's a bit more difficult for us all to stay as.....ummm...."fresh" as we'd like. You're more active now, and you're growing up, so I'm just passing along a friendly reminder that showering and deodorant routines should be stepped up as you grow up.
Then I might make some connections to Science class, where they recently learned about the skin in their Human Body Systems Unit. We talk about using sunscreen, and we share a few sunburn stories. Finally, I pull out the deodorant samples and they talk about the various options for "dude" deodorant and "chick" deodorant.
Since stinky feet are also a huge problem in my class, I pass along my Mom's anti-stinky-feet method - I demonstrate how to use spray deodorant on your feet after a shower (yes, I actually spray my own bare feet in class!) and how to spray a little in your shoes to keep that nasty Micrococcus Sedentarius bacteria at bay. (I frequently have high school kids come back to tell me how much they still appreciate that bit of advice!)
How do you handle a "stinky" class?