1. "What a nice smell!," the man said.

2. "What a nice smell," the man said.
3. "What a nice smell!" the man said.

(Which one is grammatically correct? It is about punctuation mark?)

2 answers

#3 is correct; the others have punctuation issues.
Because "What a nice smell" is something you would say with excitement, #3 is correct. If it were another quote like, "I like your shirt," it could look like #1 or #3 because it could be meant enthusiastically (exclamation) or not (declarative).