diff --git a/library/ZendAfi/Mail.php b/library/ZendAfi/Mail.php index e3ae925f9eaf6ac72db321b5666a226dcd5aa530..7cdc113456d7e8d0acd8c0d8880092ab1109f5af 100644 --- a/library/ZendAfi/Mail.php +++ b/library/ZendAfi/Mail.php @@ -39,8 +39,12 @@ class ZendAfi_Mail extends Zend_Mail { public function addBcc($email) { $validator = new Zend_Validate_EmailAddress(); - if ($validator->isValid($email)) - parent::addBcc($email); + + try { + if ($validator->isValid($email)) + parent::addBcc($email); + } catch (Zend_Validate_Exception $e) { + } } } diff --git a/tests/library/Class/NewsletterMailingTest.php b/tests/library/Class/NewsletterMailingTest.php index e6b5f33e9d63ece317a4685dff670c05bcb3e881..f3de8efd9a63a21fef764eb517d285959086a8ad 100644 --- a/tests/library/Class/NewsletterMailingTest.php +++ b/tests/library/Class/NewsletterMailingTest.php @@ -69,6 +69,13 @@ class NewsletterMailingAnimationsTestSendMail extends ModelTestCase { ->setMail('zork'); + $this->zorkglub = new Class_Users(); + $this->zorkglub + ->setPrenom('') + ->setNom('zorkglub') + ->setMail('zork@creutzwaldenergies-services.fr+'); + + $this->animations = new Class_Newsletter(); $this->animations ->setTitre('Animations du mois') @@ -79,6 +86,7 @@ class NewsletterMailingAnimationsTestSendMail extends ModelTestCase { ->addUser($this->rdubois) ->addUser($this->mduchamp) ->addUser($this->zork) + ->addUser($this->zorkglub) ->setExpediteur(null); $this->mock_transport = new MockMailTransport();