Suppose that we want to construct a non-surjective homomorphism $$ f: \mathbb{Z}_{12} \longrightarrow \mathbb{Z}_{30} $$ Since $\mathbb{Z}_{12}$ is cyclic, $f$ is completely determined from the image of $\overline{1}$ (its generator), $f(\overline{1})$. For the homomorphism to be well-defined, $f(\overline{1})$ must equal $\overline{d}$, where $d$ is a common divisor of $12$ and $30$.
If $f(\overline{1})=\overline{1}$, $f$ is surjective. By excluding this case, we're left with the possible $f$s: $$ f(x)=d \cdot x, \quad d\in \{2,3,6\} $$
The one requirement for $f(1)$ which must be fulfilled is $$ 0=f(0)=f(12\cdot 1)=12f(1) $$ Among elements in $\Bbb Z_{30}$, these are exactly the elements which are multiples of $5$.