Last active
December 28, 2015 17:09
-
-
Save stefanheimes/7533853 to your computer and use it in GitHub Desktop.
Test recipient for a valid email. Use avisot.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$objResult = Database::getInstance() | |
->prepare('SELECT id, email FROM orm_avisota_recipient') | |
->execute(); | |
$objTester = new Swift_Mime_Grammar(); | |
while($objResult->next()) | |
{ | |
if (!preg_match('/^' . $objTester->getDefinition('addr-spec') . '$/D', $objResult->email)) | |
{ | |
echo "<pre>"; | |
var_dump($objResult->id); | |
var_dump($objResult->email); | |
echo "</pre>"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment