Let $R$ be a nonzero commutative ring with $1$, such that all finite matrices over $R$ have a *Smith normal form*. Does it follow that $R$ is a principal ideal domain?

If this fails, suppose we additionally suppose that $R$ is an integral domain?

What can we say if we impose the additional condition that the diagonal entries be unique up to associates?