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


PHP PHPMailer::addEmbeddedImage方法代码示例

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


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

示例1: initMailFromSet

 /**
  * Inner mailer initialization from set variables
  *
  * @return void
  */
 protected function initMailFromSet()
 {
     $this->mail->setLanguage($this->get('langLocale'), $this->get('langPath'));
     $this->mail->CharSet = $this->get('charset');
     $this->mail->From = $this->get('from');
     $this->mail->FromName = $this->get('fromName') ?: $this->get('from');
     $this->mail->Sender = $this->get('from');
     $this->mail->clearAllRecipients();
     $this->mail->clearAttachments();
     $this->mail->clearCustomHeaders();
     $emails = explode(static::MAIL_SEPARATOR, $this->get('to'));
     foreach ($emails as $email) {
         $this->mail->addAddress($email);
     }
     $this->mail->Subject = $this->get('subject');
     $this->mail->AltBody = $this->createAltBody($this->get('body'));
     $this->mail->Body = $this->get('body');
     // add custom headers
     foreach ($this->get('customHeaders') as $header) {
         $this->mail->addCustomHeader($header);
     }
     if (is_array($this->get('images'))) {
         foreach ($this->get('images') as $image) {
             // Append to $attachment array
             $this->mail->addEmbeddedImage($image['path'], $image['name'] . '@mail.lc', $image['name'], 'base64', $image['mime']);
         }
     }
 }
开发者ID:kirkbauer2,项目名称:kirkxc,代码行数:33,代码来源:Mailer.php

示例2: addEmbeddedImage

 /**
  * {@inheritdoc}
  */
 public function addEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = 'application/octet-stream', $disposition = 'inline')
 {
     $this->_aAttachments[] = array($path, basename($path), $name, $encoding, $type, false, $disposition, $cid);
     return parent::addEmbeddedImage($path, $cid, $name, $encoding, $type, $disposition);
 }
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:8,代码来源:oxemail.php

示例3: testMultiEmbeddedImage

 /**
  * An embedded attachment test.
  */
 public function testMultiEmbeddedImage()
 {
     $this->Mail->Body = 'Embedded Image: <img alt="phpmailer" src="' . 'cid:my-attach">' . 'Here is an image!</a>';
     $this->Mail->Subject .= ': Embedded Image + Attachment';
     $this->Mail->isHTML(true);
     if (!$this->Mail->addEmbeddedImage(realpath($this->INCLUDE_DIR . '/examples/images/phpmailer.png'), 'my-attach', 'phpmailer.png', 'base64', 'image/png')) {
         $this->assertTrue(false, $this->Mail->ErrorInfo);
         return;
     }
     if (!$this->Mail->addAttachment(__FILE__, 'test.txt')) {
         $this->assertTrue(false, $this->Mail->ErrorInfo);
         return;
     }
     $this->buildBody();
     $this->assertTrue($this->Mail->send(), $this->Mail->ErrorInfo);
 }
开发者ID:jbs321,项目名称:portfolio,代码行数:19,代码来源:phpmailerTest.php

示例4: addEmbeddedImage

 /**
  * Adds an embedded attachment (check phpmail documentation for more details)
  *
  * @param string $sFullPath Path to the attachment.
  * @param string $sCid      Content ID of the attachment. Use this to identify the Id for accessing the image in an HTML form.
  * @param string $sAttFile  Overrides the attachment name.
  * @param string $sEncoding File encoding (see $Encoding).
  * @param string $sType     File extension (MIME) type.
  *
  * @return bool
  */
 public function addEmbeddedImage($sFullPath, $sCid, $sAttFile = '', $sEncoding = 'base64', $sType = 'application/octet-stream')
 {
     $this->_aAttachments[] = array($sFullPath, basename($sFullPath), $sAttFile, $sEncoding, $sType, false, 'inline', $sCid);
     return parent::addEmbeddedImage($sFullPath, $sCid, $sAttFile, $sEncoding, $sType);
 }
开发者ID:JulianaSchuster,项目名称:oxid-frontend,代码行数:16,代码来源:oxemail.php

示例5: testIcal

 /**
  * iCal event test.
  */
 public function testIcal()
 {
     $this->Mail->Body = 'This is the <strong>HTML</strong> part of the email.';
     $this->Mail->AltBody = 'This is the text part of the email.';
     $this->Mail->Subject .= ': iCal';
     $this->Mail->isHTML(true);
     $this->buildBody();
     require_once '../extras/EasyPeasyICS.php';
     $ICS = new EasyPeasyICS('PHPMailer test calendar');
     $ICS->addEvent(strtotime('tomorrow 10:00 Europe/Paris'), strtotime('tomorrow 11:00 Europe/Paris'), 'PHPMailer iCal test', 'A test of PHPMailer iCal support', 'https://github.com/PHPMailer/PHPMailer');
     $this->Mail->Ical = $ICS->render(false);
     $this->assertTrue($this->Mail->send(), $this->Mail->ErrorInfo);
     $this->Mail->Body = 'Embedded Image: <img alt="phpmailer" src="cid:my-attach">' . 'Here is an image!</a>.';
     $this->Mail->AltBody = 'This is the text part of the email.';
     $this->Mail->Subject .= ': iCal + inline';
     $this->Mail->isHTML(true);
     $this->Mail->addEmbeddedImage('../examples/images/phpmailer.png', 'my-attach', 'phpmailer.png', 'base64', 'image/png');
     $this->buildBody();
     $this->assertTrue($this->Mail->send(), $this->Mail->ErrorInfo);
 }
开发者ID:ahmedash95,项目名称:Lily,代码行数:23,代码来源:phpmailerTest.php


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