Skip to content
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

getHTMLBody() return html with message headers #491

Open
vkamelin opened this issue Apr 27, 2024 · 1 comment
Open

getHTMLBody() return html with message headers #491

vkamelin opened this issue Apr 27, 2024 · 1 comment

Comments

@vkamelin
Copy link

vkamelin commented Apr 27, 2024

Simple code from example:

$client->connect();

//Get all Mailboxes
/** @var \Webklex\PHPIMAP\Support\FolderCollection $folders */
$folders = $client->getFolders();

//Loop through every Mailbox
/** @var \Webklex\PHPIMAP\Folder $folder */
foreach($folders as $folder){

    //Get all Messages of the current Mailbox $folder
    /** @var \Webklex\PHPIMAP\Support\MessageCollection $messages */
    $messages = $folder->messages()->fetchOrderDesc()->paginate(5, 1)->all();

    /** @var \Webklex\PHPIMAP\Message $message */
    foreach($messages as $message){
        echo $message->getSubject().'<br />';
        echo 'Attachments: '.$message->getAttachments()->count().'<br />';
        echo $message->getHTMLBody();
    }
}

$message->getHTMLBody() return html with message headers.

Desktop / Server (please complete the following information):

  • OS: Ubuntu
  • PHP: 7.1

Sometims it happens with $message->getTextBody()

@vkamelin
Copy link
Author

And in one of s messages getHTMLBody() return.. I don't know.. some bytes. It's attachment or may be something wrong with encoding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant