Yii is a great basis for validating the form, today I am going to show you how to validate the email field on the form before submitting it. It is very simple, just follow the example below.
if you created the user model with email as one attribute, then add the following code in the rules function.
public function rules() { return array( ... array('email', 'email','checkMX'=>true), ... ); }
thats it
source share