Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.11

Doc Bug #18936 Example for Mail_mime not working
Submitted: 2011-10-28 17:52 UTC
From: panamajo Assigned: alec
Status: Closed Package: Mail_Mime (version 1.8.2)
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: 1.8.3    
Comments Add Comment Add patch

Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem : 43 - 31 = ?

 [2011-10-28 17:52 UTC] panamajo (Jo Schulze)
Description: ------------ The example code here: <> does not work. This is caused by the use of the undocumented method txtHeaders() instead of the documented headers(). Both return the given headers plus additional headers added by Mail_mime depending on which attachments, HTML body etc have been added before. But txtHeaders() returns them as a string (suitable for the native PHP mail() function, while headers() returns them as array, suitable for Mail::send(). Especially for a n00b no example is better than a broken example. Test script: --------------- Try the example script, just replace the last line with: $rc = $mail->send('', $hdrs, $body); if($rc instanceof PEAR_Error) { trigger_error($rc->getMessage()); } else { // do whatever to indicate it worked $mail = TRUE; } Expected result: ---------------- No warning, notice, whatever. Mail sent. Actual result: -------------- $headers must be an array in ... No mail sent.


 [2011-10-30 12:04 UTC] alec (Aleksander Machniak)
-Status: Open +Status: Closed -Assigned To: +Assigned To: alec
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.