emailvalidator Email validator

EEmailValidator is a validator class which relies on Manuel Lemos' e-mail address validation class (see that class for further dependencies)

This validator performs basic regex validation and some advanced checks using getmxrr to verify the validity of a given e-mail address.

Manuel Lemos' class uses an alternate GetMXRR function from the DNSResolver code by Moriyoshi Koizumi, in case the getmxrr function is not available or is not working. His code is not OOP, so I tried to make PHP5 classes with it, but it's not fully tested, so, if you don't have a working getmxrr or are under windows, either use it under your own risk or send me patches ;)

Please read the source code for the meaning of the various properties.



  • Yii 1.0 or above
  • Extract the release file under protected/extensions

In the view:

<?php echo CHtml::activeLabel($user, 'email'); ?>
<?php echo CHtml::activeTextField($user, 'email', 
        array('title'=>Yii::t('demo', 'Enter your e-mail'))); ?>
<?php echo CHtml::error($user, 'email'); ?>

In the model:

class UserModel extends CFormModel
   public $email;

   public function rules()
      return array(

   public function attributeLabels()
      return array(
         'email'=>Yii::t('demo', 'Enter your e-mail address: '),
3 0
1 728 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Validation
Developed by: MetaYii
Created on: Nov 19, 2008
Last updated: 15 years ago


show all