svn: /pear/peardoc/trunk/en/package/mail/mail-mime/ example.xml
[email protected] (Aleksander Machniak) Sun, 30 Oct 2011 07:05:40 +0000
| Newsgroups | php.pear.doc |
|---|---|
| Message-ID | <[email protected]> |
alec Sun, 30 Oct 2011 07:05:40 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=318571
Log:
- Fixed Bug #18936: Example for Mail_mime not working
Bug: http://pear.php.net/bugs/18936 (unknown)
Changed paths:
U pear/peardoc/trunk/en/package/mail/mail-mime/example.xml
Modified: pear/peardoc/trunk/en/package/mail/mail-mime/example.xml
===================================================================
--- pear/peardoc/trunk/en/package/mail/mail-mime/example.xml 2011-10-30 06:54:49 UTC (rev 318570)
+++ pear/peardoc/trunk/en/package/mail/mail-mime/example.xml 2011-10-30 07:05:40 UTC (rev 318571)
@@ -10,8 +10,8 @@
<![CDATA[
<?php
-include('Mail.php');
-include('Mail/mime.php');
+include 'Mail.php';
+include 'Mail/mime.php' ;
$text = 'Text version of email';
$html = '<html><body>HTML version of email</body></html>';
@@ -28,14 +28,9 @@
$mime->setHTMLBody($html);
$mime->addAttachment($file, 'text/plain');
-// do not ever try to call these lines in reverse order
-// when using versions older than 1.6.0
$body = $mime->get();
-// or in 1.6.0 and newer
-// $body = $mime->getMessageBody();
+$hdrs = $mime->headers($hdrs);
-$hdrs = $mime->txtHeaders($hdrs);
-
$mail =& Mail::factory('mail');
$mail->send('postmaster@localhost', $hdrs, $body);