Pop\Mail\Mail::cc PHP Method

cc() public method

Alias to set the cc headers
public cc ( string $email, string $name = null ) : Mail
$email string
$name string
return 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
ファイル: MailTest.php プロジェクト: nicksagona/PopPHP
 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'));
 }