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 9060029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:07:10+00:00 2026-06-16T15:07:10+00:00

Im really confused on this, i have an email that is generated from a

  • 0

Im really confused on this, i have an email that is generated from a log file, it sends an email with the contents of the log file in the body.

I done some testing as im new to imap stuff and php in general on a test gmail account, with the following code i could see the whole body of hundreds of emails without issue:

$mailbox = "xxx@gmail.com";
$mailboxPassword = "xxxx";

$mailbox = imap_open("{imap.gmail.com:993/imap/ssl}INBOX", $mailbox, $mailboxPassword);

$mail = imap_search($mailbox,'ALL');

if(empty($mail)) die('No unread emails found!');

foreach ($mail as $key => $val) 
{

// Retrieving message headers
$headers = imap_headerinfo($mailbox, $val);

// Retrieving subject
$subject = $headers->subject;

p.s i can echo the subject and all is returned fine

 mb_internal_encoding("UTF-8");
 $subject = mb_decode_mimeheader(str_replace('_', ' ', $subject));

 $body_pre = imap_fetchbody($mailbox, $val, 1);
 $body = $body_pre ? imap_qprint(imap_fetchbody($mailbox, $val, 2)) : imap_qprint(imap_fetchbody($mailbox, $val, 1));

 if (empty($body))
    {
    $body = $body_pre;  
    }

Now the code is probably messy, i basically took over someone elses code and made it work for me, i added the if empty one because some of the bodys was returning empty, once i added that it worked fine. I know its due to Russian/French encoding so although the info displays fine the russian/french characters dont display correctly but its at least not empty

Anyway basically what i done was took the original email, forwarded it to this test account, ran that code and if i echoed out $body i could see every email body.

Now the problem occurred when i took the exact same emails, there all the same email logs from a txt file basically sent as an email, but when i ran the same query on the inbox with basically only difference they have FW: in the subject well this is what the body outputted as:

SE0yIENyYXNoIExvZyBDb250ZW50cyBCZWxvdzo8YnIgLz48YnIgLz5Vc2VyIEVtYWlsOiBBbm9u
LiAtIE5vdCBTdXBwbGllZDxhbm9uQGhvbGRlbW1hbmFnZXIuY29tPjxiciAvPkJ1aWxkIEluZm86
IDIuMC4wLjc2NjU8YnIgLz5Vc2VyIERlc2NyaXB0aW9uOiBOL0E8YnIgLz48YnIgLz5Mb2cgRmls
ZSBDb250ZW50czogPGJyIC8+PGJyIC8+MDE6MTI6MTMuMTEwIFtNYWluOjEgLSBVbml0eUJvb3Rz
dHJhcHBlci5SdW5dIDxiciAvPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX18gICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxiciAvPg0KICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICggICApICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxiciAvPg0KICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICB8IHwgLi0uICAgIF9fXyAuLS4gLi0uICAgICAuLS0uICAg
IDxiciAvPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IHwvICAgXCAgKCAgICkgICAn

And body_pre echoes as empty

I tried changing to this also and echoing all these and they all displayed blank

$body_pre0 = imap_fetchbody($mailbox, $val);
    $body_pre = imap_fetchbody($mailbox, $val, 1);
    $body_pre1 = imap_fetchbody($mailbox, $val, 1.1);
    $body_pre2 = imap_fetchbody($mailbox, $val, 1.2);
    $body_pre3 = imap_fetchbody($mailbox, $val, 2);
    $body_pre4 = imap_fetchbody($mailbox, $val, 2.0);
    $body_pre5 = imap_fetchbody($mailbox, $val, 2.1);
    $body_pre6 = imap_fetchbody($mailbox, $val, 2.2);
    $body_pre7 = imap_fetchbody($mailbox, $val, 2.3);
    echo "Body 0: <br /><br /><br />" . $body_pre0 . "<br />";
    echo "Body 1: <br /><br /><br />" . $body_pre . "<br />";
    echo "Body 1.1: <br /><br /><br />" . $body_pre1 . "<br />";
    echo "Body 1.2: <br /><br /><br />" . $body_pre2 . "<br />";
    echo "Body 2: <br /><br /><br />" . $body_pre3 . "<br />";
    echo "Body 2.0: <br /><br /><br />" . $body_pre4 . "<br />";
    echo "Body 2.1: <br /><br /><br />" . $body_pre5 . "<br />";
    echo "Body 2.2: <br /><br /><br />" . $body_pre6 . "<br />";
    echo "Body 2.3: <br /><br /><br />" . $body_pre7 . "<br />";

Im a bit lost and would love a bit of guidance so i dont lose my mind before the new year 🙂

The email has a bunch of confidential stuff, i can add it with that all blanked out if it helps but i presume since the forwarded emails works and not the original its probably some encoding type issue or something obvious but let me know if adding that helps, most emails are huge so it would take a long time to edit all confidential info but can do if you request

  • 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-16T15:07:11+00:00Added an answer on June 16, 2026 at 3:07 pm

    that doesn’t look like garbage to me… it looks like base64 encoded html…

    In [4]: print base64.b64decode(corpus)
    HM2 Crash Log Contents Below:<br /><br />User Email: Anon. - Not Supplied<anon@holdemmanager.com><br />Build Info: 2.0.0.7665<br />User Description: N/A<br /><br />Log File Contents: <br /><br />01:12:13.110 [Main:1 - UnityBootstrapper.Run] <br />
                                 ___                                <br />
                                (   )                               <br />
                                 | | .-.    ___ .-. .-.     .--.    <br />
                                 | |/   \  (   )   '
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, I have really confused myself. We have this app that concates values and
I'm really confused and have been scratching my head over this for a few
I am really confused about this.I have set the background color of the whole
I am really confused on this regex things. I have tried to understand it,
I have an exam tomorrow in this and I'm getting really confused about this
I'm really confused with this whole measuring thing that android does for layouts. Basically,
I am getting really confused with this concept: If I want to implement a
I am really confused about how I can do this. I need to get
I'm really confused, I just wrote this x = 0 y = 42 #Can
I'm really confused. I'm using Django 1.4 and I've been searching for this the

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.