/**
  * Test the parsing of a recipient header (i.e. "To:") into a PHPMailer-compatible array.
  */
 public function testAddressHeaderToArray()
 {
     $addressHeader = '"Butts, Seymour" <*****@*****.**>, "I.P. Freely"<*****@*****.**>, johnsmith@gmail.com, <*****@*****.**>';
     $addressHeaderArray = EmailDeliveryBehavior::addressHeaderToArray($addressHeader);
     $this->assertEquals(array(array('Butts, Seymour', '*****@*****.**'), array('I.P. Freely', '*****@*****.**'), array('', '*****@*****.**'), array('', '*****@*****.**')), $addressHeaderArray);
 }
Example #2
0
 public function validateEmail($option, $optRule)
 {
     if (isset($option['value'])) {
         try {
             EmailDeliveryBehavior::addressHeaderToArray($option['value']);
         } catch (CException $e) {
             return array(false, $e->getMessage());
         }
     }
     return array(true, '');
 }