php-imap-client icon indicating copy to clipboard operation
php-imap-client copied to clipboard

Sometimes email body is empty

Open qualityplatforms opened this issue 7 years ago • 6 comments

Feature request or bug

bug

If a bug, what did you expect to happen?

get the body of the message

If a bug, what happened?

$mail->message->plain & $mail->message->html receives an null

If a bug, list steps to reproduce bugs.

The problem exist when i have an long conversation. After like 5 replies the mail receives nothing. I was using roundcube for replies.

If a bug, did you do these steps?

[X] Download and use the lastest stable version [X] See if the issue has already been reported [X] Debug

Side notes(Read then del this chunk)

https://gist.github.com/qualityplatforms/068c5bf75008cea736014d2e665293c6

qualityplatforms avatar Jan 19 '18 12:01 qualityplatforms

Having long conversations may be an issue. I cannot seem to replicate it. If someone else can replicate this, we will look into fixing it.

mattparksjr avatar Jan 31 '18 18:01 mattparksjr

Hi,

Same problem here, all emails from a member of my team are empty. [_body:SSilence\ImapClient\Section:private] is always empty. I suspected his email client but I use Outlook for IOS like him without any problem. We both use an Office 365 account of the same organisation to send emails.

I can reproduce the case, so if I can help do not hesitate.

Regards,

Cowprod avatar Apr 13 '18 13:04 Cowprod

I have the same issue I believe, I am trying to fetch exactly same email from Office 365 via POP3, that previously worked without problems via IMAP coming from outtlook.com server. Perhaps there is an issue with Office 365 message structure? It has 'html' but no 'plain'.

As a workaround I added this in IncomingMessage.php, line 409:

$objNew->text = null;

        //!debug
        $foo = $objNew->html->body;
        $objNew->text->body = strip_tags(imap_base64($foo));

Now, I am getting the body from 'html'

b-and-p avatar Mar 20 '19 11:03 b-and-p

Ok, my problem is office365 related, not a bug, reference: https://communities.bmc.com/thread/167192?start=0&tstart=0

b-and-p avatar Mar 20 '19 12:03 b-and-p

When you implemented $objNew->text->body = strip_tags(imap_base64($foo)); Does the body still come in as HTML?

cbielich avatar Jul 10 '19 21:07 cbielich

I was having a similar issue using plain but works using text

$message = $mail->message->html; if (trim($message) == '') { $message = $mail->message->text; }

cbielich avatar Jul 13 '19 17:07 cbielich