Usage example – Download
Posted by php-manual on Jan 26, 2009 in Miscellaneous |
Please remove .txt extension from filename after downloading
Please remove .txt extension from filename after downloading
Copyright © 2010 PHP, Web and IT stuff All rights reserved. PHP Web development in London.
Download above file or see code below
< ?php
// the email to validate
$email = 'joe@gmail.com';
// an optional sender
$sender = 'user@example.com';
// instantiate the class
$SMTP_Valid = new SMTP_validateEmail();
// do the validation
$result = $SMTP_Valid->validate($email, $sender);
// view results
var_dump($result);
echo $email.' is '.($result ? 'valid' : 'invalid')."\n";
// send email?
if ($result) {
//mail(...);
}
?>
Cannot re-assign $this in C:\Program Files\xampp\php\pear\Net\DNS\RR.php
Thanks for file and the php attachment
Warning: Invalid argument supplied for foreach() on line: 90
When validating one email, like the example, not only does it fail but you get a PHP warning.
You have to explode the emails first to get this to work properly.
In the class, on line 120 put this:
$emails = explode(‘,’,$emails);
You can edit the separator to ; or whatever you like.
Hope this helps