php-imap
php-imap copied to clipboard
replaceInternalLinks() return empty string
- PHP IMAP version: 4.1
- PHP Version: 7.4
- Type of execution: Web server
I tried to get html content with with internal links using replaceInternalLinks() method, but it always return an empty string. (the email html was fetched perfectly ) https://github.com/barbushin/php-imap/blob/7ca3d19451bfe6de47186b52f4b266179a5858b9/src/PhpImap/IncomingMail.php#L182
When i changed the source code from $fetchedHtml = $this->textHtml; To (string) $this->__get('textHtml');
it worked fine!! is this a bug or i missed something!!
Can you please show us your relevant code, so that we can see what you are trying to do?
Can you please show us your relevant code, so that we can see what you are trying to do?
I was trying to save the email on database, i had to change the inline attachment URI so it appear correctly to the user
// ......
// Load eventual attachment into attachments directory
if( ! $this->load_attachments){
$mailbox->setAttachmentsIgnore(true);
}
// Replace inline attachments links
// Here replaceInternalLinks returns empty string
// When i changed the source code, it works fine
// See my post above
$contentHtml = $mail->replaceInternalLinks($attachdir);
$contentHtml = mb_convert_encoding($contentHtml, 'UTF-8');
$inbox = new MailInbox();
$inbox->content_html = $contentHtml;
//.....
Can you still reproduce this issue with the release 4.3.0?