Question

I wanted to integrate a verified email address functionality in CakePHP 1.3.

I have used valid email address regular expressions but I have never ever verified an email address' domain (a valid domain name means existing domain name).

I know how this is done in plain PHP but I want to use CakePHP's functionality to achieve this.

Was it helpful?

Solution

There is already built-in functionality you can use.

Read the documentation:

Note the boolean $deep = false param which you can use to actually check for the domains existence.

OTHER TIPS

assign this into your model

public $validate = array(       
        'email' => array(
            'email' => array(
                'rule' => array('email',true),
                'message' => 'Your custom message here',
                //'allowEmpty' => false,
                //'required' => false,
                //'last' => false, // Stop validation after this rule
                //'on' => 'create', // Limit validation to 'create' or 'update' operations
            ),
);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top