
 Arek Koc - 2013-03-06 12:09:09
I'm sending e-mails with images and text to my users, every time other images. I'm doing it by loop every time creating object, images etc
while(..)
 {
  $message_object = new email_message_class;
  # adding something about 10 images
  $message_object->CreateFilePart($obraz,$pipd);
  #... etc
  $message_object->Send();
 }
But after sending something about 100, sometimes 150 mails I have memory trouble
PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted 
Every message have something about 30KB. I don't cache images, CreateFileImage parameter table looks like
  $obraz['FileName']="/home/www/image.gif";
  $obraz['Content-Type']='automatic/name';
  $obraz['Name']='image.gif';
  $obraz['Disposition']='inline';
  #$obraz['Cache']=1;
I tried
$message_object->Send();
unset($message_object);
but have the same effect.
So probably CreateFileImage function is making cache of the image files no mather of $obraz['Cache']=1 parameter, I didn't found any function to destruct it permamently.
Have you any suggestion?