Classical Stein's lemma says that if $\mathbf{X}$ is a centered Gaussian random vector and $g$ is a function which is nice enough, we have $$ \mathbb{E} \, X_i \, g ( \mathbf{X} ) = \sum_k \operatorname{cov} (X_i, X_k)\, \mathbb{E} \frac{\partial g}{\partial x_k}. $$ I wonder if there is some infinite dimensional analogue of this lemma, saying something like $$ \mathbb{E} \, X ( t ) \, g ( X) = \int \mathbb{E} \operatorname{cov}(X(t), X(s)) D_{X(s)} g \ ds $$ if $X$ is a continuous real-valued Gaussian process satisfying some assumptions, $g$ is some nice enough functional and $D$ is some derivative-like operator.

I know that my question is rather vague, I was curious since I needed to compute expectations like the one on the left and Stein's lemma immediately popped in mind.

**Mostly unrelated question.** Most of the sources demand that $g$ be continuously differentiable for the classical lemma to hold. It seems that this is not necessary. It should be enough for these derivatives $\partial_k g$ to exist in the distributional sense, because they are immediately integrated against normal density. Is there some source where the lemma is formulated like this?