The right answer is bad, meaning that your smell is not good (and so go and have a shower please! 🙂 )
If you said ‘you smell badly’ you would be saying that the person you’re talking to doesn’t know how to or can’t smell properly.
The same way you’d say ‘you look good in that dress!’ and not ‘you look
well in that dress’. Like in the sentence above ‘you smell bad’, also in this case the focus is NOT on HOW we perform the action (‘to look’ and ‘to smell’) .
This is why you say:
I feel bad for not coming to your wedding (= here I’m not discussing whether I’m good or bad at feeling stuff, I’m just saying that as a result of feeling something I’m sad)
He looked sad last time I saw him (=he seemed sad)
The adverb ‘badly’ says something about how you carry out an action. For instance, you’d be correct in saying ‘John behaves badly at school’ because you’re talking about the way John is carrying out an action (‘to behave’).
So this is why you say:
He looked at me sadly(=he looked at me in a sad way)
HOWEVER, you could say ‘I smell badly’ if you meant that you’re not good at smelling things maybe because of a cold.
I hope I’ve explained it well enough.