TYPO3  7.6
Validate.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of SwiftMailer.
5  *
6  * For the full copyright and license information, please view the LICENSE
7  * file that was distributed with this source code.
8  */
9 
16 {
22  private static $grammar = null;
23 
31  public static function email($email)
32  {
33  if (self::$grammar === null) {
35  ->lookup('mime.grammar');
36  }
37 
38  return (bool) preg_match(
39  '/^'.self::$grammar->getDefinition('addr-spec').'$/D',
40  $email
41  );
42  }
43 }