Referring to the figure, the bob is in equilibrium under the action of the following three forces
(a) The electrical force qE acting along the direction of electric field
(b) The weight mg acting vertically downward.
(c) The tension T along the string.
Resolving the tension along horizontal and vertical directions,
we find T cos θ=mg and T sin θ=qE
∴qEmg=T sin θT cos θ=tan θ
∴E=mg tan θq