Helpful thoughts from John Piper:
Can a pastor preach on joy when he is feeling little of it?
Yes. He is preaching what the word says and will say it whether he feels it or not.
Yes. He will be praying that in the very preaching of it, the gift of joy might be given. It does happen.
Yes. He will be honest with his people and over time communicate to them that he has his ups and downs and may have to preach on a text that does not find great fulfillment in his life at the time of preaching.
Yes. But over time the disjunction between text and person will undermine the ministry of the word. Preaching is expository exultation, and when the exultation is missing for extended periods of time, life will contradict content and this will weaken or even kill the ministry of the word.