idnSupported() public method

Tells whether IDNs (Internationalized Domain Names) are supported or not. This requires the "intl" and "mbstring" PHP extensions.
public idnSupported ( ) : boolean
return boolean "true" if required functions for IDN support are present
Example #1
16
 /**
  * Tests removal of duplicate recipients and reply-tos.
  */
 public function testDuplicateIDNRemoved()
 {
     if (!$this->Mail->idnSupported()) {
         $this->markTestSkipped('intl and/or mbstring extensions are not available');
     }
     $this->Mail->clearAllRecipients();
     $this->Mail->clearReplyTos();
     $this->Mail->CharSet = 'utf-8';
     $this->assertTrue($this->Mail->addAddress('test@françois.ch'));
     $this->assertFalse($this->Mail->addAddress('test@françois.ch'));
     $this->assertTrue($this->Mail->addAddress('test@FRANÇOIS.CH'));
     $this->assertFalse($this->Mail->addAddress('test@FRANÇOIS.CH'));
     $this->assertTrue($this->Mail->addAddress('*****@*****.**'));
     $this->assertFalse($this->Mail->addAddress('*****@*****.**'));
     $this->assertFalse($this->Mail->addAddress('*****@*****.**'));
     $this->assertTrue($this->Mail->addReplyTo('test+replyto@françois.ch'));
     $this->assertFalse($this->Mail->addReplyTo('test+replyto@françois.ch'));
     $this->assertTrue($this->Mail->addReplyTo('test+replyto@FRANÇOIS.CH'));
     $this->assertFalse($this->Mail->addReplyTo('test+replyto@FRANÇOIS.CH'));
     $this->assertTrue($this->Mail->addReplyTo('*****@*****.**'));
     $this->assertFalse($this->Mail->addReplyTo('*****@*****.**'));
     $this->assertFalse($this->Mail->addReplyTo('*****@*****.**'));
     $this->buildBody();
     $this->assertTrue($this->Mail->send(), $this->Mail->ErrorInfo);
     // There should be only one "To" address and one "Reply-To" address.
     $this->assertEquals(1, count($this->Mail->getToAddresses()), 'Bad count of "to" recipients');
     $this->assertEquals(1, count($this->Mail->getReplyToAddresses()), 'Bad count of "reply-to" addresses');
 }