php-imap
php-imap copied to clipboard
Missing email bodies (v2), with example to reproduce
Hi @Webklex
webklex/laravel-imap version 2.4 webklex/php-imap version 2.5
I'm still trying to get this v2 to prod, was doing some final tests and then ran into a situation where the email bodies were not identified by v2.
After a bit of "what the hell is happening", I realised that it was only for emails sent from Spark (https://sparkmailapp.com), and only on v2, for v1 the body was identified and could be retrieved.
The email in question displays properly in gmail, as well as when using v1 to retrieve it, it seems to only be on v2. I was able to reproduce this with the below email (Had to change extension from .eml to .txt as GitHub doesn't allow uploading .eml)
When running
$messages = $inbox->query()
->whereSubject("a normal email, nothing fancy here")
->setFetchBody(true)
->since(now()->subDay())
->limit(1)
->get();
I get the following:
- First dump is the subject line
- Second dump is the result of
$message->getHTMLBody()
- which is null - Third dump is the actual message just getting dumped. You can see there only one key text which is just an empty string
In gmail, the email appears as:
Could you please see if you can reproduce this with the provided example?
Thanks
@Webklex were you able to reproduce this one?
I am also facing same (empty body) issue while using sparkmail
Hi @peanut24 @afrazahmmad ,
please give v3.0.0-alpha a try. The default boundary regex used to detect the message parts in a multi-part message has been changed and can now also be modified via the config options.boundary
parameter inside your configuration.
Best regards,