Let $(X,\delta,\mu)$ be a normal space of homogeneous type of order $\gamma$. Gatto and V\'agi \cite{GV2} showed that, if $f$ and $I_\alpha f$ are in $L^p(X)$ $(0<\alpha<\min(\gamma,1/p))$, then $I_\alpha f$ is in $C^{p,\alpha}(X)$, where $I_\alpha$ is the Riesz potential of order $\alpha$ and $C^{p,\alpha}$ is the space of smooth functions of Calder\'on-Scott \cite{CS}. In this paper, we introduce a generalized Riesz potential $I_\phi$ and extend the result above. With this aim, we extend the Hardy-Littlewood-Sobolev inequality to the Orlicz space.