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


PHP Zend_Mime_Message::getMime方法代码示例

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


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

示例1: testGenerate

 public function testGenerate()
 {
     $msg = new Zend_Mime_Message();
     // No Parts
     $p1 = new Zend_Mime_Part('This is a test');
     $p2 = new Zend_Mime_Part('This is another test');
     $msg->addPart($p1);
     $msg->addPart($p2);
     $res = $msg->generateMessage();
     $mime = $msg->getMime();
     $boundary = $mime->boundary();
     $p1 = strpos($res, $boundary);
     // $boundary must appear once for every mime part
     $this->assertTrue($p1 !== false);
     if ($p1) {
         $p2 = strpos($res, $boundary, $p1 + strlen($boundary));
         $this->assertTrue($p2 !== false);
     }
     // check if the two test messages appear:
     $this->assertTrue(strpos($res, 'This is a test') !== false);
     $this->assertTrue(strpos($res, 'This is another test') !== false);
     // ... more in ZMailTest
 }
开发者ID:crodriguezn,项目名称:crossfit-milagro,代码行数:23,代码来源:MessageTest.php

示例2: getObject

 /**
  * Returns the internal Zend mail object.
  *
  * @return Zend_Mail Zend mail object
  */
 public function getObject()
 {
     if (!empty($this->_embedded)) {
         $parts = array();
         if ($this->_html != null) {
             $part = new Zend_Mime_Part($this->_html);
             $part->charset = $this->_object->getCharset();
             $part->encoding = Zend_Mime::ENCODING_QUOTEDPRINTABLE;
             $part->disposition = Zend_Mime::DISPOSITION_INLINE;
             $part->type = Zend_Mime::TYPE_HTML;
             $parts = array($part);
         }
         $msg = new Zend_Mime_Message();
         $msg->setParts(array_merge($parts, $this->_embedded));
         // create html body (text and maybe embedded), modified afterwards to set it to multipart/related
         $this->_object->setBodyHtml($msg->generateMessage());
         $related = $this->_object->getBodyHtml();
         $related->type = Zend_Mime::MULTIPART_RELATED;
         $related->encoding = Zend_Mime::ENCODING_8BIT;
         $related->boundary = $msg->getMime()->boundary();
         $related->disposition = null;
         $related->charset = null;
     } else {
         if ($this->_html != null) {
             $this->_object->setBodyHtml($this->_html);
         }
     }
     return $this->_object;
 }
开发者ID:nos3,项目名称:ai-zend,代码行数:34,代码来源:Zend.php

示例3: testCSVFileUpload

 public function testCSVFileUpload()
 {
     $this->markTestIncomplete('The implementation is not yet finished and needs adaptation to new unit tests system.');
     try {
         $this->_httpClient->setUri($this->_baseUri . '/files');
         $this->_httpClient->setMethod(Zend_Http_Client::POST);
         $msg = new Zend_Mime_Message();
         $jsonPart = new Zend_Mime_Part('{}');
         $jsonPart->type = 'application/json';
         $jsonPart->filename = microtime(true) . '.json';
         $jsonPart->disposition = 'attachment';
         $msg->addPart($jsonPart);
         $xmlPart = new Zend_Mime_Part($this->_icc . ',GEM17223,2,SIM_Model,APN1,10.1.2.1,1,TM SPAIN');
         $xmlPart->type = 'text/plain';
         $xmlPart->filename = microtime(true) . '.csv';
         $xmlPart->disposition = 'attachment';
         $msg->addPart($xmlPart);
         $this->_httpClient->setHeaders('Content-Type', 'multipart/mixed; boundary="' . $msg->getMime()->boundary() . '"');
         $this->_httpClient->setRawData($msg->generateMessage());
         $res = $this->_httpClient->request();
         $this->assertEquals(200, $res->getStatus());
         $obj = json_decode($res->getBody());
         $this->assertTrue(is_object($obj));
         $this->assertNotEmpty($obj->customerData);
     } catch (Exception $e) {
         $this->fail($e->getMessage());
     }
 }
开发者ID:SandeepUmredkar,项目名称:PortalSMIP,代码行数:28,代码来源:PreinventoryExternalTest.php


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