本文整理汇总了PHP中Cake\Network\Email\Email::bcc方法的典型用法代码示例。如果您正苦于以下问题:PHP Email::bcc方法的具体用法?PHP Email::bcc怎么用?PHP Email::bcc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cake\Network\Email\Email
的用法示例。
在下文中一共展示了Email::bcc方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _prepareRecipientAddresses
/**
* Prepares the recipient email addresses.
*
* @return array
*/
protected function _prepareRecipientAddresses()
{
$to = $this->_cakeEmail->to();
$cc = $this->_cakeEmail->cc();
$bcc = $this->_cakeEmail->bcc();
return array_merge(array_keys($to), array_keys($cc), array_keys($bcc));
}
示例2: testSendWithEmail
/**
* TestSend method
*
* @return void
*/
public function testSendWithEmail()
{
$Email = new Email();
$Email->from('noreply@cakephp.org', 'CakePHP Test');
$Email->to('cake@cakephp.org', 'CakePHP');
$Email->cc(['mark@cakephp.org' => 'Mark Story', 'juan@cakephp.org' => 'Juan Basso']);
$Email->bcc('phpnut@cakephp.org');
$Email->subject('Testing Message');
$Email->transport('queue');
$config = $Email->config('default');
$this->QueueTransport->config($config);
$result = $this->QueueTransport->send($Email);
$this->assertEquals('Email', $result['jobtype']);
$this->assertTrue(strlen($result['data']) < 10000);
$output = unserialize($result['data']);
//debug($output);
//$this->assertEquals($Email, $output['settings']);
}
示例3: sendMail
public function sendMail($to, $subject, $from, $message, $attachments = null, $emailCofig = 'default', $emailtemplate = 'default', $formate = 'html', $replyto = null, $cc = null, $bcc = null)
{
$email = new Email('default');
$email->emailFormat($formate);
$email->from(array($from => Configure::read('FROM_EMAIL_NAME')));
$email->to($to);
$email->cc($cc);
$email->bcc($bcc);
$email->replyTo($replyto);
$email->subject($subject);
$email->template($emailtemplate, 'default');
// $email->attachments($attachments);
if ($email->send($message)) {
return true;
} else {
return false;
}
}
示例4: testRcpt
/**
* testRcpt method
*
* @return void
*/
public function testRcpt()
{
$email = new Email();
$email->from('noreply@cakephp.org', 'CakePHP Test');
$email->to('cake@cakephp.org', 'CakePHP');
$email->bcc('phpnut@cakephp.org');
$email->cc(array('mark@cakephp.org' => 'Mark Story', 'juan@cakephp.org' => 'Juan Basso'));
$this->socket->expects($this->at(0))->method('write')->with("MAIL FROM:<noreply@cakephp.org>\r\n");
$this->socket->expects($this->at(1))->method('read')->will($this->returnValue(false));
$this->socket->expects($this->at(2))->method('read')->will($this->returnValue("250 OK\r\n"));
$this->socket->expects($this->at(3))->method('write')->with("RCPT TO:<cake@cakephp.org>\r\n");
$this->socket->expects($this->at(4))->method('read')->will($this->returnValue(false));
$this->socket->expects($this->at(5))->method('read')->will($this->returnValue("250 OK\r\n"));
$this->socket->expects($this->at(6))->method('write')->with("RCPT TO:<mark@cakephp.org>\r\n");
$this->socket->expects($this->at(7))->method('read')->will($this->returnValue(false));
$this->socket->expects($this->at(8))->method('read')->will($this->returnValue("250 OK\r\n"));
$this->socket->expects($this->at(9))->method('write')->with("RCPT TO:<juan@cakephp.org>\r\n");
$this->socket->expects($this->at(10))->method('read')->will($this->returnValue(false));
$this->socket->expects($this->at(11))->method('read')->will($this->returnValue("250 OK\r\n"));
$this->socket->expects($this->at(12))->method('write')->with("RCPT TO:<phpnut@cakephp.org>\r\n");
$this->socket->expects($this->at(13))->method('read')->will($this->returnValue(false));
$this->socket->expects($this->at(14))->method('read')->will($this->returnValue("250 OK\r\n"));
$this->SmtpTransport->setEmail($email);
$this->SmtpTransport->sendRcpt();
}