Add validation to php Swiftmailer

i want to Add the validation i made to swift mailer but i don’t know where should i add it please guys i need your help to solve this and when i can not include any external file to the library then how could i add my validation file ?

private function _assertValidAddress($address)
{
    if (!preg_match('/^' . $this->getGrammar()->getDefinition('addr-spec') . '$/D',
        $address))
    {
    throw new Swift_RfcComplianceException(
        'Address in mailbox given [' . $address .
          '] does not comply with RFC 2822, 3.6.2.'
         );
    }
}

Add validation to php Swiftmailer