Welcome to the Cookbook

loading...

4.1.4.9 email

This checks whether the data is a valid email address. Passing a boolean true as the second parameter for this rule will also attempt to verify that the host for the address is valid.

var $validate = array('email' => array('rule' => 'email'));
 
var $validate = array(
    'email' => array(
        'rule' => array('email', true),
        'message' => 'Please supply a valid email address.'
    )
);
  1. var $validate = array('email' => array('rule' => 'email'));
  2. var $validate = array(
  3. 'email' => array(
  4. 'rule' => array('email', true),
  5. 'message' => 'Please supply a valid email address.'
  6. )
  7. );