Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7893647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:11:10+00:00 2026-06-03T07:11:10+00:00

I’m doing this piping php script that fetch the arriving emails and the parse

  • 0

I’m doing this piping php script that fetch the arriving emails and the parse it and show it. I used this tutorial: http://www.damnsemicolon.com/php/parse-emails-in-php-with-email-piping-part-1 (and the following ones), I tried it with a standard email that I had sent to my server and it did work well, but then i tried another and I got a lot of errors. I used the print_r($decoded); to show me all of the different parts of the email and instead of getting a fully parse email, all the content of the emails goes to the $decode[0][‘body]; Why is this happening? (I will not post the code cause it’s the same as the tutorials)

print_r($decode)= Array (
    [0] => Array ( 
         [Headers] => Array ( ) 
         [Parts] => Array ( ) 
         [Position] => 0 
         [Body] => From jtferreira@teste.local Thu Apr 26 12:33:44 2012 Received: from [192.168.1.92] by ubuntuserver.lan with esmtp (Exim 4.76) (envelope-from ) id 1SNMxE-0000VB-TR for jtferreira@teste.local; Thu, 26 Apr 2012 12:33:44 +0100 Message-ID: <4F993299.8040605@teste.local> Date: Thu, 26 Apr 2012 12:33:45 +0100 From: =?ISO-8859-1?Q?=22Jo=E3o_Ferreira_=28m=E1quina_virtual=29=22?= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 To: jtferreira@teste.local Subject: Sample Email Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit It's the same? 
         [BodyPart] => 1 
         [BodyLength] => 744 
     )
 )

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T07:11:11+00:00Added an answer on June 3, 2026 at 7:11 am

    As Mario said, the problem was with the UTF 8-BOM. If anyone have this problem, I recomend you to use this code:

    <?php
    // substitua pelo caminho para o arquivo que deseja limpar
    $file = "C:/wamp/www/wordpress/wp-content/themes/basic-gray/lib/langs.php";
    print removeUTF8BOM($file) ? 'BOM removido!' : 'Não havia BOM a ser removido...';
    
    function removeUTF8BOM($fil) {
    $newcontent = '';
    $first = false;
    $fh = fopen($fil, 'r');
      while($part = fread($fh, 1024)) {
        if(!$first) {
          if(preg_match('/^\xEF\xBB\xBF/', $part)) {
          $newcontent = preg_replace('/^\xEF\xBB\xBF/', "", $part);
          } else {
          fclose($fh);
          return false;
          }
        $first = true;
        } else $newcontent .= $part;
      }
    fclose($fh);
    $fh = fopen($fil, 'w');
    fwrite($fh, $newcontent);
    fclose($fh);
    return true;
    }
    ?>
    

    (http://www.caugb.com.br/2009/07/remover-o-bom-de-arquivos-em-utf-8/)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
this is what i have right now Drawing an RSS feed into the php,
I am doing a simple coin flipping experiment for class that involves flipping a
I have a French site that I want to parse, but am running into
I'm trying to create an if statement in PHP that prevents a single post
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.