附件
使用 Example #1 带附件的邮件 <?php
require_once 'Zend/Mail.php';
$mail = new Zend_Mail();
// build message...
$mail->createAttachment($someBinaryString);
$mail->createAttachment($myImage, 'image/gif', Zend_Mime::DISPOSITION_INLINE, Zend_Mime::ENCODING_8BIT);
如果你想得到对此附件MIME段产生的更多控制,你可以使用 <?php
require_once 'Zend/Mail.php';
$mail = new Zend_Mail();
$at = $mail->createAttachment($myImage);
$at->type = 'image/gif';
$at->disposition = Zend_Mime::DISPOSITION_INLINE;
$at->encoding = Zend_Mime::ENCODING_8BIT;
$at->filename = 'test.gif';
$mail->send();
创建 <?php
require_once 'Zend/Mail.php';
$mail = new Zend_Mail();
$at = new Zend_Mime_Part($myImage);
$at->type = 'image/gif';
$at->disposition = Zend_Mime::DISPOSITION_INLINE;
$at->encoding = Zend_Mime::ENCODING_8BIT;
$at->filename = 'test.gif';
$mail->addAttachment($at);
$mail->send();
|