Dealing with toddlers can be challenging because you need to build a bridge of communication and get them to understand how their behavior impacts those around them.
I would exclaim, "Ouch! You hurt mommy," and then make a sad face to help him connect his acting out of aggressive impulses to the fact that he is hurting the person who takes care of him. Not sure why you would say, "No thank you" to him. No one in the real world would ever say that in response to someone causing them physical harm.
I suggest you read this book about dealing with toddlers which teaches you how to use NLP (Neuro Linguistic Programming) to talk to your child so he will understand what you mean.