$Hom(K,Hom(M,E))\cong Hom(K\otimes M,E)$
$F$ is flat iff $F\otimes -$ is exact.
Let $E$ be injective cogeneratorinjective cogenerator. Then $0 \longrightarrow X \longrightarrow Y \longrightarrow Z \longrightarrow 0$ is exact iff $0 \longrightarrow Hom(Z, E) \longrightarrow Hom(Y, E) \longrightarrow Hom(X, E) \longrightarrow 0$ is exact.
Using (1) and (2), you can see that If $M$ is flat then $Hom(m,E)$ is injective (as abx said). Using (3), you can see that if $E$ is injective cogenerator, then you have also the necessary condition.