PHP Classes

qmail class large attachment and cache

Recommend this page to a friend!

      MIME E-mail message sending  >  MIME E-mail message sending package blog  >  How Can PHP Send Emai...  >  All threads  >  qmail class large attachment and cache  >  (Un) Subscribe thread alerts  
Subject:qmail class large attachment and cache
Summary:Sending html mail with 7mb attachment hangs if cache on =1
Messages:2
Author:Paul Graham
Date:2010-08-15 12:32:48
Update:2010-08-15 21:26:44
 

  1. qmail class large attachment and cache   Reply   Report abuse  
Picture of Paul Graham Paul Graham - 2010-08-15 12:32:49
Hello.

This is a two part question.

Using qmail/emailmessage to send html emails with a 7MB attachment.
If the cache option is on e.g.

$attachment=array(
"Data"=>file_get_contents($attachment_url),
"Name"=>$attachment_name,
"Content-Type"=>"automatic/name",
"Disposition"=>"attachment","Cache"=>1
);

The the send:
$error=$email_message->Send();

Just seems to hang.

I do not seem to be getting anything from the return error message either:
if(strcmp($error,""))

This also seems to happen when sending bulk emails too quickly.
I do not seem to get an error returned but the process simply seems to hang?

Any suggestions as to :1 why turningon caching could cause this.
and 2: why I often do not get an error message returned? Possibly the script has been timedout by the server???





  2. Re: qmail class large attachment and cache   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2010-08-15 21:26:44 - In reply to message 1 from Paul Graham
Halting with large attachments suggests that your PHP memory limit was exceeded and PHP exited during the build of the message body in the memory. To avoid this problem you need to increase memory_limit value in the php.ini file or just send smaller files.