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


PHP Zend_Mail_Protocol_Smtp::data方法代码示例

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


在下文中一共展示了Zend_Mail_Protocol_Smtp::data方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _sendMail

 /**
  * Send an email via the SMTP connection protocol
  *
  * The connection via the protocol adapter is made just-in-time to allow a
  * developer to add a custom adapter if required before mail is sent.
  *
  * @return void
  * @todo Rename this to sendMail, it's a public method...
  */
 public function _sendMail()
 {
     // If sending multiple messages per session use existing adapter
     if (!$this->_connection instanceof Zend_Mail_Protocol_Smtp) {
         // Check if authentication is required and determine required class
         $connectionClass = 'Zend_Mail_Protocol_Smtp';
         if ($this->_auth) {
             $connectionClass .= '_Auth_' . ucwords($this->_auth);
         }
         if (!class_exists($connectionClass)) {
             Zend_Loader::loadClass($connectionClass);
         }
         $this->setConnection(new $connectionClass($this->_host, $this->_port, $this->_config));
         $this->_connection->connect();
         $this->_connection->helo($this->_name);
     } else {
         // Reset connection to ensure reliable transaction
         $this->_connection->rset();
     }
     // Set sender email address
     $this->_connection->mail($this->_mail->getReturnPath());
     // Set recipient forward paths
     foreach ($this->_mail->getRecipients() as $recipient) {
         $this->_connection->rcpt($recipient);
     }
     // Issue DATA command to client
     $this->_connection->data($this->header . Zend_Mime::LINEEND . $this->body);
 }
开发者ID:kobmaki,项目名称:icingaweb2,代码行数:37,代码来源:Smtp.php

示例2: testDataBeforeRcptThrowsException

 /**
  * @depends testEhlo
  * @expectedException Zend_Mail_Protocol_Exception
  */
 public function testDataBeforeRcptThrowsException()
 {
     $this->_connectAndEhlo();
     $this->_protocol->data('foo');
 }
开发者ID:omusico,项目名称:logica,代码行数:9,代码来源:SmtpProtocolTest.php


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