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


PHP Headers::addHeaderLine方法代码示例

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


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

示例1: headers

 /**
  * Access headers collection
  *
  * Lazy-loads if not already attached.
  * 
  * @return Headers
  */
 public function headers()
 {
     if (null === $this->headers) {
         $this->setHeaders(new Headers());
         $this->headers->addHeaderLine('Date', date('r'));
     }
     return $this->headers;
 }
开发者ID:bradley-holt,项目名称:zf2,代码行数:15,代码来源:Message.php

示例2: testSendMinimalMail

 public function testSendMinimalMail()
 {
     $headers = new Headers();
     $headers->addHeaderLine('Date', 'Sun, 10 Jun 2012 20:07:24 +0200');
     $message = new Message();
     $message->setHeaders($headers)->setSender('ralph.schindler@zend.com', 'Ralph Schindler')->setBody('testSendMailWithoutMinimalHeaders')->addTo('zf-devteam@zend.com', 'ZF DevTeam');
     $expectedMessage = "RSET\r\n" . "MAIL FROM:<ralph.schindler@zend.com>\r\n" . "DATA\r\n" . "Date: Sun, 10 Jun 2012 20:07:24 +0200\r\n" . "Sender: Ralph Schindler <ralph.schindler@zend.com>\r\n" . "To: ZF DevTeam <zf-devteam@zend.com>\r\n" . "\r\n" . "testSendMailWithoutMinimalHeaders\r\n" . ".\r\n";
     $this->transport->send($message);
     $this->assertEquals($expectedMessage, $this->connection->getLog());
 }
开发者ID:haoyanfei,项目名称:zf2,代码行数:10,代码来源:SmtpTest.php

示例3: testSendEscapedEmail

 public function testSendEscapedEmail()
 {
     $headers = new Headers();
     $headers->addHeaderLine('Date', 'Sun, 10 Jun 2012 20:07:24 +0200');
     $message = new Message();
     $message->setHeaders($headers)->setSender('ralph.schindler@zend.com', 'Ralph Schindler')->setBody("This is a test\n.")->addTo('zf-devteam@zend.com', 'ZF DevTeam');
     $expectedMessage = "EHLO localhost\r\n" . "MAIL FROM:<ralph.schindler@zend.com>\r\n" . "DATA\r\n" . "Date: Sun, 10 Jun 2012 20:07:24 +0200\r\n" . "Sender: Ralph Schindler <ralph.schindler@zend.com>\r\n" . "To: ZF DevTeam <zf-devteam@zend.com>\r\n" . "\r\n" . "This is a test\r\n" . "..\r\n" . ".\r\n";
     $this->transport->send($message);
     $this->assertEquals($expectedMessage, $this->connection->getLog());
 }
开发者ID:pnaq57,项目名称:zf2demo,代码行数:10,代码来源:SmtpTest.php

示例4: testHeadersAddHeaderLineThrowsExceptionOnMissingFieldValue

 public function testHeadersAddHeaderLineThrowsExceptionOnMissingFieldValue()
 {
     $this->setExpectedException('Zend\\Mail\\Exception\\InvalidArgumentException', 'without a field');
     $headers = new Headers();
     $headers->addHeaderLine('Foo');
 }
开发者ID:bradley-holt,项目名称:zf2,代码行数:6,代码来源:HeadersTest.php

示例5: mailAdd

 public function mailAdd($version, $id, $srcNodeId, $srcUserNickname, $dstNodeId, $subject, $text, $checksum, $relayCount, $encryptionMode, $status, $timeCreated, $timeReceived)
 {
     $this->log->info('mail add: ' . $id);
     $this->log->info('subject: ' . $subject);
     $this->log->info('from: ' . $srcNodeId);
     $this->log->info('nick: ' . $srcUserNickname);
     $headers = new ZendMailHeaders();
     $headers->addHeaderLine('Date', date('r', $timeReceived));
     $headers->addHeaderLine('X-Version', $version);
     $headers->addHeaderLine('X-Id', $id);
     $headers->addHeaderLine('X-Checksum', $checksum);
     $headers->addHeaderLine('X-RelayCount', $relayCount);
     $headers->addHeaderLine('X-EncrptionMode', $encryptionMode);
     $headers->addHeaderLine('X-Status', $status);
     $headers->addHeaderLine('X-TimeCreated', $timeCreated);
     $headers->addHeaderLine('X-TimeReceived', $timeReceived);
     $message = new ZendMailMessage();
     $message->setHeaders($headers);
     $message->addFrom($srcNodeId . '@phpchat.fox21.at', $srcUserNickname);
     $message->addTo($dstNodeId . '@phpchat.fox21.at');
     $message->setSubject($subject);
     $message->setBody($text);
     $this->server->addMail($message);
 }
开发者ID:thefox,项目名称:phpchat,代码行数:24,代码来源:ImapCommand.php

示例6: testHeadersAddHeaderLineThrowsExceptionOnMissingFieldValue

 public function testHeadersAddHeaderLineThrowsExceptionOnMissingFieldValue()
 {
     $this->setExpectedException('Zend\\Mail\\Header\\Exception\\InvalidArgumentException', 'Header must match with the format "name: value"');
     $headers = new Mail\Headers();
     $headers->addHeaderLine('Foo');
 }
开发者ID:razvansividra,项目名称:pnlzf2-1,代码行数:6,代码来源:HeadersTest.php

示例7: setExtHeaders

 /**
  * Sets additional message headers
  *
  * @param \Zend\Mail\Headers $headers
  * @param array $data
  */
 protected function setExtHeaders(&$headers, array $data)
 {
     $headers->addHeaderLine(self::UID, $data[self::UID]);
     $headers->addHeaderLine('InternalDate', $data[self::INTERNALDATE]);
 }
开发者ID:xamin123,项目名称:platform,代码行数:11,代码来源:Imap.php

示例8: setHeaders

 /**
  * Compose headers
  *
  * @param   \Zend\Mail\Headers  $headers
  * @return  \Zork\Mail\Message
  */
 public function setHeaders(Headers $headers)
 {
     $headers->addHeaderLine('User-Agent', static::USER_AGENT)->addHeaderLine('X-Mailer', static::USER_AGENT);
     return parent::setHeaders($headers);
 }
开发者ID:gridguyz,项目名称:zork,代码行数:11,代码来源:Message.php


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