本文整理汇总了PHP中Horde_Mime_Part::setContentID方法的典型用法代码示例。如果您正苦于以下问题:PHP Horde_Mime_Part::setContentID方法的具体用法?PHP Horde_Mime_Part::setContentID怎么用?PHP Horde_Mime_Part::setContentID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Horde_Mime_Part
的用法示例。
在下文中一共展示了Horde_Mime_Part::setContentID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: htmlspecialchars
$textpart = new Horde_Mime_Part();
$textpart->setType('text/plain');
$textpart->setCharset('UTF-8');
$textpart->setContents(_("You have been sent an Ecard. To view the Ecard, you must be able to view text/html messages in your mail reader. If you are viewing this message, then most likely your mail reader does not support viewing text/html messages."));
/* Create the multipart/related part. */
$related = new Horde_Mime_Part();
$related->setType('multipart/related');
/* Create the HTML part. */
$htmlpart = new Horde_Mime_Part();
$htmlpart->setType('text/html');
$htmlpart->setCharset('UTF-8');
/* The image part */
$imgpart = new Horde_Mime_Part();
$imgpart->setType($image->getType('screen'));
$imgpart->setContents($image->raw('screen'));
$img_tag = '<img src="cid:' . $imgpart->setContentID() . '" /><p />';
$comments = $htmlpart->replaceEOL(Horde_Util::getFormData('ecard_comments'));
if (!Horde_Util::getFormData('rtemode')) {
$comments = '<pre>' . htmlspecialchars($comments, ENT_COMPAT, 'UTF-8') . '</pre>';
}
$htmlpart->setContents('<html>' . $img_tag . $comments . '</html>');
$related->setContentTypeParameter('start', $htmlpart->setContentID());
$related->addPart($htmlpart);
$related->addPart($imgpart);
/* Create the multipart/alternative part. */
$alternative = new Horde_Mime_Part();
$alternative->setType('multipart/alternative');
$alternative->addPart($textpart);
$alternative->addPart($related);
/* Add them to the mail message */
$alt = new Horde_Mime_Mail(array('Subject' => _("Ecard - ") . Horde_Util::getFormData('image_desc'), 'To' => $to, 'From' => $from));