How to verify email address using the Zend Email Validator
Take a look at the following form element against which I have added the Zend Email Validator
$email = new Zend_Form_Element_Text('email'); $email->setLabel('Email Address') ->setRequired(true) ->addFilter('StripTags') ->addFilter('StringTrim') ->addValidator('NotEmpty') ->addValidator(new Zend_Validate_EmailAddress( array('domain' => true) ));
The above code will check the domain part of the email address provided by the customer.
Once the visitor tries to enter invalid email address then the system will flag the error message. Please see below