EEmailSmtpValidator validates that the attribute value is a valid e-mail address, using SMTP.
It is heavily based on SMTP_validateEmail and uses Net/DNS on plattforms without getmxrr.
This validator should be considered as an improvement of EEmailValidator.
Citing the author of the SMTP email validation class: "this class is meant to be a secondary validation of an email address after the email syntax is validated. It can also provide intermediate email validation before sending a confirmation email to the email address, which does not provide user feedback if the email is invalid - and thus loss of users."
Resources ¶
Documentation ¶
Requirements ¶
- Yii 1.0 or above
- Net/DNS (bundled)
Installation ¶
- Extract the release file under
protected/extensions
Usage ¶
In the model:
public $email;
public function rules()
{
return array(
array('email',
'application.extensions.emailsmtpvalidator.EEmailSmtpValidator',
'strictValidation'=>true,
'nameServers'=>array('192.168.0.1')))
}
Properties ¶
/**
* SMTP Port
*/
private $port = 25;
/**
* Nameservers to use when make DNS query for MX entries
* @var Array $nameservers
*/
private $nameServers = array('localhost');
/**
* How many seconds to wait before each attempt to connect to the
* destination e-mail server
*
* @var integer
*/
private $timeOut = 10;
/**
* How many seconds to wait for data exchanged with the server.
* Set to a non zero value if the data timeout will be different
* than the connection timeout.
*
* @var integer
*/
private $dataTimeOut = 5;
/**
* The address of the sending user
*
* @var string
*/
private $sender = 'postmaster@localhost';
/**
* If it is not possible to verify if the e-mail address is id,
* and this flag is set to true, then the validation will fail.
*
* @var boolean
*/
private $strictValidation = false;
help
did anyone using this ext? teach me please.. i dont understand 'nameServers'=>array('192.168.0.1')))
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.