Skip to content

Instantly share code, notes, and snippets.

@stefanheimes
Last active December 28, 2015 17:09
Show Gist options
  • Save stefanheimes/7533853 to your computer and use it in GitHub Desktop.
Save stefanheimes/7533853 to your computer and use it in GitHub Desktop.
Test recipient for a valid email. Use avisot.
<?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