regex - Read MIME data using PHP -


I have a third party program, which basically allows users to send email and then display it in the system Does. But the problem is that it is generating an output like this: I just want to take this data and format it for things to be presented. Do I Want to Avoid Reggae Is Any More Theorem There are no alternatives or standard ways to show the content below in fashion? Actually I'll add everything as $ text below and then call a function like clean ($ text) type.

  & gt; This message is in MIME format. Since your mail reader does not understand this format, so some or all messages may not be legible. --b_3331365494_4098727 Content-type: text / plain; Charset = "US-ASCII" Material-Transfer-Encoding: 7-bit Test - B_3331365494_4098727 Content-Type: Text / html; Charset = "US-ASCII" content-transfer-encoding: quoted-printable & lt; HTML & gt; & Lt; HEAD & gt; & Lt; Title & gt; Test & lt; / Title & gt; & Lt; / HEAD> & Lt; Body & gt; & Lt; FONT FACE = "Calibri, Verdana, Helvetica, Aile" & gt; Span style = 'font-size: 11pt' & gt; Test & lt; / SPAN & gt; & Lt; / FONT> & Lt; / Body & gt; & Lt; / Html & gt; - B_3331365494_4098727--  

There is a great class to decode MIME messages. Once installed, you can use it like this:

  $ message = new Mail_mimeDecode ($ text); $ Params ['Incorporate- body'] = true; $ Params ['decode_bodies'] = true; $ Params ['decode_headers'] = true; $ MessageStruct = $ message- & gt; Decods ($ params); // messagestruct now represents an array message that is properly contained from all the parts I  

Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -