| Recommend this page to a friend! |
| PHP MIME Email Message Parser | > | All threads | > | decode attachment | > | (Un) Subscribe thread alerts |
| |||||||||||||||
the message contain attachment phpclasses newsletter
script parse message attachment not a real message real message have a text only body tnx
I am not sure what you want to say. Can you please provide an example of your problem?
Class decode (incorrect) attachment message
message have a body in html + text and attachment message (this should not be decoded) tnx Return-Path: [email protected] Received: from h16528019 ([127.0.0.1]) by H16528019 ; Wed, 16 Dec 2009 22:45:23 +0100 Message-ID: <8B9CB829CAC1466EB33FE84D50DB43D8@h16528019> From: "Gufo Rosso" <[email protected]> To: "admin" <[email protected]> Subject: rr Date: Wed, 16 Dec 2009 22:45:22 +0100 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0015_01CA7EA1.73AAFAA0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 This is a multi-part message in MIME format. ------=_NextPart_000_0015_01CA7EA1.73AAFAA0 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0016_01CA7EA1.73AAFAA0" ------=_NextPart_001_0016_01CA7EA1.73AAFAA0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable rrrrr ------=_NextPart_001_0016_01CA7EA1.73AAFAA0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859-1"> <META content=3D"MSHTML 6.00.2900.5512" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>rrrrr</FONT></DIV></BODY></HTML> ------=_NextPart_001_0016_01CA7EA1.73AAFAA0-- ------=_NextPart_000_0015_01CA7EA1.73AAFAA0 Content-Type: message/rfc822; name="[PHP Classes] New class daily digest of 2009-12-13.eml" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="[PHP Classes] New class daily digest of 2009-12-13.eml"
This message seems incomplete. Are you sure you copied the whole message?
Return-Path: [email protected]
Received: from h16528019 ([127.0.0.1]) by H16528019 ; Wed, 16 Dec 2009 22:45:23 +0100 Message-ID: <8B9CB829CAC1466EB33FE84D50DB43D8@h16528019> From: "Gufo Rosso" <[email protected]> To: "admin" <[email protected]> Subject: rr Date: Wed, 16 Dec 2009 22:45:22 +0100 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0015_01CA7EA1.73AAFAA0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 This is a multi-part message in MIME format. ------=_NextPart_000_0015_01CA7EA1.73AAFAA0 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0016_01CA7EA1.73AAFAA0" ------=_NextPart_001_0016_01CA7EA1.73AAFAA0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable rrrrr ------=_NextPart_001_0016_01CA7EA1.73AAFAA0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859-1"> <META content=3D"MSHTML 6.00.2900.5512" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>rrrrr</FONT></DIV></BODY></HTML> ------=_NextPart_001_0016_01CA7EA1.73AAFAA0-- ------=_NextPart_000_0015_01CA7EA1.73AAFAA0 Content-Type: message/rfc822; name="[PHP Classes] New class daily digest of 2009-12-13.eml" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="[PHP Classes] New class daily digest of 2009-12-13.eml" Delivered-To: [email protected] Received: by 10.239.159.211 with SMTP id z19cs159017hbc; Mon, 14 Dec 2009 03:30:08 -0800 (PST) Received: by 10.100.233.35 with SMTP id f35mr6965308anh.41.1260790207371; Mon, 14 Dec 2009 03:30:07 -0800 (PST) Return-Path: <[email protected]> X-Priority: 3 X-MSMail-Priority: Normal Received: from phpclasses.org (phpclasses.org [216.240.132.150]) by mx.google.com with SMTP id 40si4863249ywh.131.2009.12.14.03.30.06; Mon, 14 Dec 2009 03:30:07 -0800 (PST) Received-SPF: pass (google.com: domain of [email protected] designates 216.240.132.150 as permitted sender) client-ip=216.240.132.150; Authentication-Results: mx.google.com; spf=pass (google.com: domain of [email protected] designates 216.240.132.150 as permitted sender) [email protected] X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 Received: (qmail 23251 invoked by uid 500); 14 Dec 2009 11:30:05 -0000 To: <[email protected]> Subject: [PHP Classes] New class daily digest of 2009-12-13 From: "PHP Classes" <[email protected]> Precedence: bulk Date: Mon, 14 Dec 2009 11:30:05 -0000 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_05C2_01CA7E9E.C84AAC70" Message-ID: <[email protected]> This is a multi-part message in MIME format. ------=_NextPart_000_05C2_01CA7E9E.C84AAC70 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable If you are seeing this is because you may need to change your preferred message format from HTML to plain text. You are getting this message because you voluntarily subscribed to the PHP Classes site. If want to switch your subscription e-mail format to plain text or just want to stop receiving messages like this, just go in the user options page: http://www.phpclasses.org/user_options.html . Please try to help yourself because it may take some time until you get human assistance. Thank you, PHP Classes ------=_NextPart_000_05C2_01CA7E9E.C84AAC70 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html lang=3D"en"> <head> <title>New class daily digest of 2009-12-13 - PHP Classes</title> <base href=3D"http://www.phpclasses.org/"> </head> <body> <style type=3D"text/css"><!-- BODY { color: black ; font-family: arial, helvetica, sans-serif; max-width:= 1280px; margin-left: auto; margin-right: auto } A:link { text-decoration: underline ; color: #0000FF } A:visited { text-decoration: underline ; color: #800080 } A:active { text-decoration: underline ; color: #800000 } =2Eback, BODY, .menu { background-color: #e4e4e8 } =2Edark, .odd { background-color: #d0d0d4 } =2Elight, .even { background-color: #dcdce0 } =2Efeaturedodd { background-color: #c5d4db } =2Efeaturedeven { background-color: #cedee6 } =2Ehighlight { background-color: #b0e0b0 } =2Eremoved { background-color: #AAAAAA; text-decoration: line-through } =2Einvalid { background-color: #ffcccc; } =2Ewarning { background-color: #ffb366; } =2Emonospace { font-family: Courier, "Courier New", monospace } =2Ebox, .menu { border-style: solid ; border-top-color: #fcfcff ; border-le= =66t-color: #fcfcff ; border-bottom-color: #707078 ; border-right-color: #7= 07078 ; border-width: 1px } =2Ebox, .framed { padding: 4px; border-radius: 8px ; -moz-border-radius: 8p= x; -webkit-border-radius: 8px; } =2Emenu { padding: 2px ; opacity: 0.95; filter:alpha(opacity=3D95); cursor:= default; } =2Eprogressbar { border-style: none; padding: 4px; background-color: #0000f= =66; background-image: url(http://files.phpclasses.org/graphics/progress.gi= =66); text-align: center; } =2Etabcontent { font-weight: bold } =2Enbld { border-width: 2px ; white-space: nowrap ; border-bottom-style: so= lid; border-bottom-color: #707078; border-top-style: none; border-left-sty= le: solid; border-left-color: #fcfcff; border-right-style: solid; border-ri= ght-color: #707078; border-bottom-left-radius: 8px ; border-bottom-right-ra= dius: 8px ; -moz-border-radius-bottomright: 8px ; -moz-border-radius-bottom= left: 8px ; -webkit-border-bottom-right-radius: 8px ; -webkit-border-bottom= -left-radius: 8px } =2Enbtd { border-width: 1px ; margin: 1px; white-space: nowrap ; border-sty= le: solid; border-bottom-color: #707078; border-top-color: #707078; border= -left-color: #fcfcff; border-right-color: #707078; border-bottom-left-radiu= s: 8px ; border-bottom-right-radius: 8px ; -moz-border-radius-bottomright: = 8px ; -moz-border-radius-bottomleft: 8px ; -webkit-border-bottom-right-radi= us: 8px ; -webkit-border-bottom-left-radius: 8px } =2Enbgd { border-width: 1px ; margin: 1px; white-space: nowrap ; padding: 0= px; border-bottom-style: none; border-top-style: solid; border-top-color: #= 707078; border-left-style: none; border-right-style: none } =2Enbpd { border-style: none } =2Enblu { border-width: 2px ; white-space: nowrap ; border-top-style: solid= ; border-top-color: #fcfcff; border-bottom-style: none; border-left-style: = solid; border-left-color: #fcfcff; border-right-style: solid; border-right-= color: #707078; border-top-left-radius: 8px ; border-top-right-radius: 8px = ; -moz-border-radius-topright: 8px ; -moz-border-radius-topleft: 8px ; -web= kit-border-top-right-radius: 8px ; -webkit-border-top-left-radius: 8px } =2Enbtu { border-width: 1px ; margin: 1px; white-space: nowrap ; border-sty= le: solid; border-top-color: #fcfcff; border-bottom-color: #fcfcff; border-= left-color: #fcfcff; border-right-color: #707078; border-top-left-radius: 8= px ; border-top-right-radius: 8px ; -moz-border-radius-topright: 8px ; -moz= -border-radius-topleft: 8px ; -webkit-border-top-right-radius: 8px ; -webki= t-border-top-left-radius: 8px } =2Enbgu { border-width: 1px ; margin: 1px; white-space: nowrap ; padding: 0= px; border-top-style: none; border-bottom-style: solid; border-bottom-color= : #fcfcff; border-left-style: none; border-right-style: none } =2Enbpu { border-style: none } =2Enbpb { border-width: 0px; background-color: inherit; } =2Enbtb { border-width: 0px; background-color: inherit; } // --></style> <div style=3D" background-color: #e4e4e8 ; color: black ;"> <div style=3D"margin-bottom: 8px"> <div style=3D"float: left"><a href=3D"http://www.phpclasses.org/"><img src= =3D"http://files.phpclasses.org/graphics/elephpant_logo.gif" width=3D"180" = height=3D"59" alt=3D"PHP Classes" align=3D"top" border=3D"0"></a></div> <div style=3D"float: right"><a href=3D"http://www.icontem.com/" target=3D"_= blank"><img src=3D"graphics/icontem.gif" width=3D"180" height=3D"59" alt=3D= "Icontem" align=3D"top" border=3D"0"></a></div> <div><h1 style=3D"text-align: center; margin: 0px">New class daily digest o= =66 2009-12-13</h1></div> <div style=3D"clear: both"></div> </div> <div style=3D"text-align: center; margin-top: 12px"><div style=3D"margin-le= =66t: auto; margin-right: auto; text-align: center"><a href=3D"http://www.p= hpclasses.org/ads/adclick.php?ssc=3D1&n=3Da102861047"><img width=3D"468= " height=3D"60" src=3D"http://www.phpclasses.org/ads/adview.php?ssc=3D1&= ;what=3Dzone:5&n=3Da102861047" border=3D"0" alt=3D"Advertisement"></a><= /div></div><br /> <!-- body_start --><center><table class=3D"box" width=3D"90%" bgcolor=3D"#d= 0d0d4"> <tr> <td>You are getting this message because you voluntarily subscribed to the = PHP Classes site. To change your newsletter or alert messages delivery opti= ons, see the instructions at <a href=3D"#instructions">the bottom of this m= essage</a>.</td> </tr> </table></center> <hr /> <center><h2>2 new classes were added to "PHP Classes" repository.</h2></cen= ter> <hr /> <UL> <H2>1. <A HREF=3D"http://www.phpclasses.org/browse/package/5785.html">ZIP c= lient</A> - <img src=3D"http://files.phpclasses.org/graphics/forum.gif" wid= th=3D"24" height=3D"24" alt=3D"This class support forum" align=3D"middle"> = <A HREF=3D"http://www.phpclasses.org/discuss/package/5785/">This class supp= ort forum</A></H2> <TABLE WIDTH=3D"90%"> <TR> <TD VALIGN=3D"top"><LI><H2>Short description:</H2></LI> <TABLE WIDTH=3D"100%"> <TR BGCOLOR=3D"#dcdce0"> <TD>Submit ZIP archives to Produce and Publish servers</TD> </TR> </TABLE> <LI><H2>Groups:</H2></LI> <TABLE WIDTH=3D"100%"> <TR> <TD BGCOLOR=3D"#dcdce0">PHP 5</TD> </TR> </TABLE> <TABLE WIDTH=3D"100%"> <TR> <TD BGCOLOR=3D"#d0d0d4">Web services</TD> </TR> </TABLE> </TD> <TD VALIGN=3D"top" WIDTH=3D"1%"><a href=3D"http://www.phpclasses.org/ads/ad= click.php?ssc=3D1&n=3Da1432443964"><img width=3D"336" height=3D"280" sr= c=3D"http://www.phpclasses.org/ads/adview.php?ssc=3D1&what=3Dzone:35&am= p;n=3Da1432443964" border=3D"0" alt=3D"Advertisement"></a></TD> </TR> </TABLE> <LI><H2>Supplied by:</H2></LI> <TABLE WIDTH=3D"90%"> <TR> <TD BGCOLOR=3D"#dcdce0">Andreas Jung</TD> </TR> </TABLE> <LI><H2>Detailed description:</H2></LI> <TABLE WIDTH=3D"90%"> <TR> <TD BGCOLOR=3D"#dcdce0">This class can be used to send ZIP archives to Prod= uce and Publish servers.<br /> <br /> It can create ZIP archives of all the files to publish in a given directory= =2E<br /> <br /> The class can send XML-RPC requests to submit the archives to a given Produ= ce an Publish server.</TD> </TR> </TABLE> </UL> <hr /> <UL> <H2>2. <A HREF=3D"http://www.phpclasses.org/browse/package/5852.html">Blitz= HTML Parser and Analyzer</A> - <img src=3D"http://files.phpclasses.org/gra= phics/forum.gif" width=3D"24" height=3D"24" alt=3D"This class support forum= " align=3D"middle"> <A HREF=3D"http://www.phpclasses.org/discuss/package/58= 52/">This class support forum</A></H2> <TABLE WIDTH=3D"90%"> <TR> <TD VALIGN=3D"top"><LI><H2>Short description:</H2></LI> <TABLE WIDTH=3D"100%"> <TR BGCOLOR=3D"#dcdce0"> <TD>Parse and analyze HTML documents</TD> </TR> </TABLE> <LI><H2>Groups:</H2></LI> <TABLE WIDTH=3D"100%"> <TR> <TD BGCOLOR=3D"#dcdce0">HTML</TD> </TR> </TABLE> <TABLE WIDTH=3D"100%"> <TR> <TD BGCOLOR=3D"#d0d0d4">PHP 5</TD> </TR> </TABLE> </TD> </TR> </TABLE> <LI><H2>Supplied by:</H2></LI> <TABLE WIDTH=3D"90%"> <TR> <TD BGCOLOR=3D"#dcdce0">sameer shelavale</TD> </TR> </TABLE> <LI><H2>Detailed description:</H2></LI> <TABLE WIDTH=3D"90%"> <TR> <TD BGCOLOR=3D"#dcdce0">This class can be used to parse and analyze HTML do= cuments.<br /> <br /> It used the DOM document extension to parse HTML documents.<br /> <br /> The class can also analyze the parsed documents and return the document enc= oding, DOCTYPE, base URL, meta tags, title, links, images, document text, w= ords in tags h1, title, a, a title, img alt, words weights and density.</TD= > </TR> </TABLE> </UL> <UL> <LI><H2>PHP Classes site tip of the day:</H2></LI> <TABLE WIDTH=3D"90%"> <TR> <TD BGCOLOR=3D"#dcdce0"><p><b><img src=3D"http://www.orkut.com/img/tr9.gif"= width=3D"134" height=3D"30" alt=3D"Join the PHP Classes site community at = Orkut" align=3D"left"><big><big><a href=3D"http://www.phpclasses.org/tips.h= tml?tip=3Dorkut">Join the PHP Classes site community in Orkut</a></big></bi= g></b></p> <hr /> <center><p><b><a href=3D"http://www.phpclasses.org/tips.html?tip=3Dweb-host= ing-comparisons">Read about other interesting tips</a></b></p></center> </TD> </TR> </TABLE> </UL> <hr /> <a name=3D"instructions"></a><center><table class=3D"box" width=3D"90%" bgc= olor=3D"#d0d0d4"> <tr> <td>If you are not interested in receiving any more messages like this one,= send an empty message to <tt><a href=3D"mailto:unsubscribe-newclasses@phpc= lasses.org">[email protected]</a></tt> or go to the <a = href=3D"http://www.phpclasses.org/user_options.html">user options page</a> = and uncheck the respective e-mail delivery option. There you can also switc= h the message format between text and HTML. Note that there are several mai= ling lists. If you want to unsubscribe from all lists at once, send an empt= y message to <tt><a href=3D"mailto:[email protected]">unsu= [email protected]</a></tt> .</td> </tr> </table></center> <!-- body_end --> <br> <div> <div style=3D"float: left"><address>For more information send a message to = <tt><a target=3D"_blank" href=3D"http://www.phpclasses.org/faq/#contact">in= =66o at phpclasses dot org</a></tt>.</address></div> <div style=3D"float: right"><table cellpadding=3D"0"> <tr> <td nowrap=3D"nowrap">Copyright (c) Icontem 1999-2009</td> <td nowrap=3D"nowrap">PHP Classes</td> </tr> </table> </div> </div> </div> </body> </html> ------=_NextPart_000_05C2_01CA7E9E.C84AAC70-- ------=_NextPart_000_0015_01CA7EA1.73AAFAA0--
I was able to parse the message successfully. If you are not getting the message body parts, make sure you are not passing the SkipBody parameters to the Decode function.
$mime=new mime_parser_class();
$mime->mbox = 0; $mime->decode_bodies = 1; $mime->decode_headers = 1; $mime->ignore_syntax_errors = 0; $mime->track_lines = 0; $mime->extract_addresses = 0; $parameters=array( 'Data'=>$data, 'SaveBody'=>'./u/', 'SkipBody'=>0 ); $mime->Decode($parameters, $decoded); should process the message is not only the attachment, instead processes the message attached. should not process the only body that reads normally the user?
The attached message is not parsed automatically. If you want to parse the attached message, you need to save it to a string or file and pass it to the parser again.
|
info at phpclasses dot org.
