luya\components\Mail::bccAddresses PHP Method

bccAddresses() 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 bccAddresses(['[email protected]', '[email protected]']); or with names php bccAddresses(['John Doe' => '[email protected]', 'Jane Doe' => '[email protected]']);
Since: 1.0.0-RC2
public bccAddresses ( array $emails ) : Mail
$emails array An array with email addresses or name => email paring to use names.
return Mail
    public function bccAddresses(array $emails)
    {
        foreach ($emails as $name => $mail) {
            if (is_int($name)) {
                $this->bccAddress($mail);
            } else {
                $this->bccAddress($mail, $name);
            }
        }
        return $this;
    }

Usage Example

Beispiel #1
0
 public function testBccAddresses()
 {
     $mail = new Mail();
     $mail->bccAddresses(['*****@*****.**', 'John Doe' => '*****@*****.**']);
     $mailerBcc = $mail->mailer->getBccAddresses();
     $this->assertSame('*****@*****.**', $mailerBcc[0][0]);
     $this->assertSame('*****@*****.**', $mailerBcc[0][1]);
     $this->assertSame('*****@*****.**', $mailerBcc[1][0]);
     $this->assertSame('John Doe', $mailerBcc[1][1]);
 }