当前位置: 首页>>代码示例>>PHP>>正文


PHP Email::cc方法代码示例

本文整理汇总了PHP中Cake\Network\Email\Email::cc方法的典型用法代码示例。如果您正苦于以下问题:PHP Email::cc方法的具体用法?PHP Email::cc怎么用?PHP Email::cc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cake\Network\Email\Email的用法示例。


在下文中一共展示了Email::cc方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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));
 }
开发者ID:ripzappa0924,项目名称:carte0.0.1,代码行数:12,代码来源:SmtpTransport.php

示例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']);
 }
开发者ID:repher,项目名称:cakephp-queue,代码行数:23,代码来源:QueueTransportTest.php

示例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;
     }
 }
开发者ID:mayurgodhanii,项目名称:cakephp_mailcomponent,代码行数:18,代码来源:MailerComponent.php

示例4: _getEmailByNewStyleCharset

 /**
  * @param mixed $charset
  * @param mixed $headerCharset
  * @return CakeEmail
  */
 protected function _getEmailByNewStyleCharset($charset, $headerCharset)
 {
     $email = new Email(array('transport' => 'debug'));
     if (!empty($charset)) {
         $email->charset($charset);
     }
     if (!empty($headerCharset)) {
         $email->headerCharset($headerCharset);
     }
     $email->from('someone@example.com', 'どこかの誰か');
     $email->to('someperson@example.jp', 'どこかのどなたか');
     $email->cc('miku@example.net', 'ミク');
     $email->subject('テストメール');
     $email->send('テストメールの本文');
     return $email;
 }
开发者ID:maitrepylos,项目名称:nazeweb,代码行数:21,代码来源:EmailTest.php

示例5: 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();
 }
开发者ID:ripzappa0924,项目名称:carte0.0.1,代码行数:30,代码来源:SmtpTransportTest.php


注:本文中的Cake\Network\Email\Email::cc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。