Pop\Mail\Mail::cc PHP 메소드

cc() 공개 메소드

Alias to set the cc headers
public cc ( string $email, string $name = null ) : Mail
$email string
$name string
리턴 Mail
    public function cc($email, $name = null)
    {
        if (is_array($email)) {
            $ccQueue = new Queue($email);
            $header = (string) $ccQueue;
        } else {
            $header = null !== $name ? $name . ' <' . $email . '>' : $email;
        }
        $this->setHeader('Cc', $header);
        return $this;
    }

Usage Example

예제 #1
0
 public function testCc()
 {
     $m = new Mail('Subject');
     $m->cc('*****@*****.**', 'Bob Smith');
     $this->assertEquals('Bob Smith <*****@*****.**>', $m->getHeader('Cc'));
     $m->cc(array('*****@*****.**', '*****@*****.**'));
     $this->assertEquals('[email protected], [email protected]', $m->getHeader('Cc'));
 }