예제 #1
0
 /**
  * Prepares the `from` email address.
  *
  * @return array
  */
 protected function _prepareFromAddress()
 {
     $from = $this->_cakeEmail->returnPath();
     if (empty($from)) {
         $from = $this->_cakeEmail->from();
     }
     return $from;
 }
예제 #2
0
 /**
  * testRcptWithReturnPath method
  *
  * @return void
  */
 public function testRcptWithReturnPath()
 {
     $email = new Email();
     $email->from('*****@*****.**', 'CakePHP Test');
     $email->to('*****@*****.**', 'CakePHP');
     $email->returnPath('*****@*****.**', 'CakePHP Return');
     $this->socket->expects($this->at(0))->method('write')->with("MAIL FROM:<*****@*****.**>\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:<*****@*****.**>\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->SmtpTransport->setEmail($email);
     $this->SmtpTransport->sendRcpt();
 }
예제 #3
0
 /**
  * Prepares the `from` email address.
  *
  * @param \Cake\Network\Email\Email $email Email instance
  * @return array
  */
 protected function _prepareFromAddress($email)
 {
     $from = $email->returnPath();
     if (empty($from)) {
         $from = $email->from();
     }
     return $from;
 }