Skip to content

Body not recognized #564

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
raxmam opened this issue Mar 13, 2025 · 3 comments
Open

Body not recognized #564

raxmam opened this issue Mar 13, 2025 · 3 comments
Labels
bug Something isn't working More information required Further information is requested validating

Comments

@raxmam
Copy link

raxmam commented Mar 13, 2025

Describe the bug
I have an email, where I check, what type, HTML or Text
$text_body = $message->hasTextBody();
$html_body = $message->hasHTMLBody();

Used config
Please provide the used config, if you are not using the package default config.

Code to Reproduce
The troubling code section which produces the reported bug.

	    	$text_body = $message->hasTextBody();
	    	$html_body = $message->hasHTMLBody();
echo "$text_body";
echo "$html_body";

Expected behavior
all are empty and not one of them is 1

Screenshots
If applicable, add screenshots to help explain your problem.

Image

Desktop / Server (please complete the following information):

  • OS: windows server 2019
  • PHP: 8.3.17
  • Version
  • Provider Outlook, Exchange

Additional context
Add any other context about the problem here.
i think it has to do with the marked in the screenshot

@raxmam
Copy link
Author

raxmam commented Mar 13, 2025

As a result, I can't get the body of the message.

@Pascal76
Copy link

maybe related to #562

@dwrana
Copy link

dwrana commented Apr 21, 2025

Have the same issue. This is triggered by Emails (like from apple mail), which are very simple plain text mails. Many mail programs create a multipart-message with a separate part for plain text, even if there is only plan text. apple mail (and maybe others) create a mail with the content-type in the header like this

"Content-Type: text/plain;
charset=utf-8
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 16.0 (3826.500.181.1.5))
X-Mailer: Apple Mail (2.3826.500.181.1.5)

simpleplaintextcontent"

These emails content is empty with php-imap. The native php extension shows the content (retrievable from structure). Even more strange: If you receive the raw email, it is also empty.

Diving into php-imaps code.
the function ->content( in
/php-imap/src/Connection/Protocols/ImapProtocol.php: 882
public function content(int|array $uids, string $rfc = "RFC822", int|string $uid = IMAP::ST_UID): Response {
gets data from the ->fetch( function. For the body part of these emails. Fetch retrieves an empty result

The code of the fetch function, using imap protocol is too complex for my abilities. please help. I can send one of these emails to a testing address

@Webklex Webklex added bug Something isn't working validating More information required Further information is requested labels Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working More information required Further information is requested validating
Projects
None yet
Development

No branches or pull requests

4 participants