Clearly, if $\mathcal{E}\le V_0$, then there is no current in the circuit and hence no heat generated in the resistor. If $\mathcal{E}>V_0$, then the charge $q$ collected on the capacitor satisfies the differential equation
$$\dot qR+\frac{q}{C}=\mathcal{E}-V_0,$$
where the terms on the left are voltage drops across the resistor and the capacitor, respectively. Solving this equation subject to the condition that $q$ is initially zero, we get