adresses() public method

If no key is used, the name is going to be ignored, if a string key is available it represents the name. php adresses(['foo@example.com', 'bar@example.com']); or with names php adresses(['John Doe' => 'john.doe@example.com', 'Jane Doe' => 'jane.doe@example.com']);
Since: 1.0.0-beta4
public adresses ( array $emails ) : Mail
$emails array An array with email adresses or name => email paring to use names.
return Mail
Beispiel #1
0
 public function testAdresses()
 {
     $mail = new Mail();
     $mail->address('*****@*****.**');
     $mail->address('*****@*****.**', 'John Doe');
     $mail->adresses(['*****@*****.**', 'Jane Doe' => '*****@*****.**']);
     $mailerTo = $mail->mailer->getToAddresses();
     $this->assertSame('*****@*****.**', $mailerTo[0][0]);
     $this->assertSame('*****@*****.**', $mailerTo[0][1]);
     $this->assertSame('*****@*****.**', $mailerTo[1][0]);
     $this->assertSame('John Doe', $mailerTo[1][1]);
     $this->assertSame('*****@*****.**', $mailerTo[2][0]);
     $this->assertSame('*****@*****.**', $mailerTo[2][1]);
     $this->assertSame('*****@*****.**', $mailerTo[3][0]);
     $this->assertSame('Jane Doe', $mailerTo[3][1]);
 }