Here's my problem : I'm working on a Zend application which generates PDF (using Html2PDF), these files are merged with PDFmerge, and then an e-mail is sent with the final file in attachment. When I want to generate 11 PDF, the files are all generated, the merged one too, but the email is not sent. The script is executed with the exec() function :
exec("php ".DOCUMENT_TOOT.generate_bulk.php " ".escapeshellarg(serialize($formData)), $output, $return);
and $output returns me this :
"Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 32 bytes) in DOCUMENT_ROOT/Library/Zend/Mail/Protocol/Smtp.php on line 315"
If I'm not wrong, the script is using 32Mo of memory, but my memory_limit is set to 1024M...
Here's my function which send the mail :
public function sendBulkEmail ($bulknumber) {
$mail_bulk=new Zend_Mail();
$mail_bulk->setFrom('[email protected]');
$mail_bulk->setSubject($bulknumber);
$mail_bulk->addTo('[email protected]');
$config = array('auth' => 'login',
'username' => '[email protected]',
'password' => 'mypassword');
$transport = new Zend_Mail_Transport_Smtp('ssl0.ovh.net', $config);
$mail_bulk->setBodyHtml("Text text text");
$mail_bulk->createAttachment(file_get_contents(DOCUMENT_ROOT.$bulknumber.".pdf"), "application/pdf", Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, $bulknumber.".pdf");
$mail_bulk->send($transport);
The size of the PDF is 1.05 Mo (so, not too big to be sent via email).
So, If someone can help me, it would be great.. ! Thank you