Open GoogleCodeExporter opened 8 years ago
Same issue,
The raw email as the <img src="cid:blahblahblah">
Also the MIME area with content-id <blahblahblah>
But the parser seems to be ignoring it.
Original comment by scubasco...@gmail.com
on 5 Jan 2011 at 2:56
I created this function to get images from the email whether they are inline or
attachments. Add it below getAttachments() function or extend the
MimeMailParser class.
public function getImages() {
$matches = array();
$imgs = array();
$i = 0;
foreach($this->parts as $part) {
$content_type = $this->getPartContentType($part);
preg_match('/^.*image\/(gif|png|jpg|jpeg|GIF|PNG|JPG|JPEG).*(name=(.+))?$/',$content_type, $matches);
if (isset($matches[1])) {
$partDispo = $this->getPartContentDisposition($part);
$disposition = ($partDispo) ? $partDispo : 'inline';
$file_name = (isset($matches[3])) ? $matches[3] : false;
if ( ! $file_name) (isset($part['disposition-filename'])) ? $part['disposition-filename'] : 'some_img'. $i .'.'. $matches[1];
$imgs[] = new MimeMailParser_attachment(
$file_name,
$content_type,
$this->getAttachmentStream($part),
$disposition,
$this->getPartHeaders($part)
);
}
$i++;
}
return $imgs;
}
Original comment by brodie.h...@gmail.com
on 17 Feb 2011 at 9:39
It would be great that image paths are converted to real path of saved (grab)
images
Original comment by epicgo...@gmail.com
on 22 Feb 2012 at 9:08
This issue is reproduced, corrected and tested
(https://github.com/eXorus/php-mime-mail-parser/issues/4)
You could use my fork if you want :
https://github.com/eXorus/php-mime-mail-parser
Original comment by eXorus.m...@gmail.com
on 28 Jul 2013 at 4:24
Original issue reported on code.google.com by
urif...@gmail.com
on 21 Mar 2010 at 2:19