In the smooth case, you definitely need to know $C^\infty$, as there are examples of compact smooth manifolds which are homeomorphic but not diffeomorphic.
On the other hand $C^\infty(M)$ does determine $M$.
Here's the sketch of the proof, which is essentially outlined in the early exercises to Milnor and Stasheff's Characteristic Classes book.
For each $x\in M$, define $ev_x:C^\infty(M)\rightarrow\mathbb{R}$ by $ev_x(f) = f(x)$ - it evaluates $f$ at the point $x$. Prove this is a surjective ring homomorphism onto a field, hence the kernel is a maximal ideal of $M$.
Show that, in fact, every maximal ideal of $M$ is of the form $\ker(ev_x)$ for some $x\in M$. (This part is no longer true in the noncompact setting. For example, the collection of smooth compactly supported functions forms a maximal ideal which is not of this form.)
Given a ring isomorphism $\phi:C^\infty(M)\rightarrow C^\infty(N)$, note that $\phi$ must take maximal ideals in $C^\infty (M)$ to maximal ideals in $C^\infty (N)$. Use this to define $f: M\rightarrow N$ by $ev_{f(x)} \circ \phi = ev_x$. To see $f$ is smooth, notice that this equation gives that for any $g\in C^\infty(M)$, we have $g(x) = (\phi(g)\circ f)(x)$. It follows that the composition of $f$ with any function in $C^\infty(N)$ is smooth, in particular with local coordinate functions (extended to the whole of $N$ using a partition of unity).