I have made a php page that sends an email message with multiple attachments. The loop which i used to attach multiple attachments and to check the size of attachments is ,
foreach(array_keys($_FILES['attach']['name']) as $key)
{
$filesize = $_FILES['attach']['size'][$key];
$extention = pathinfo ($_FILES['attach']['name'][$key] ,PATHINFO_EXTENSION
);
$name=$_FILES['attach']['name'][$key];
$data=($_FILES['attach']['tmp_name']);
$totalsize = $totalsize + $filesize;
if($totalsize > 10000000) //10mb10000000
{$err="<font color=#990000 size=1>File exceeded maximum allowed limit of 10
Mb</font>";}
else{
$source = $_FILES['attach']['tmp_name'][$key];
$filename = $_FILES['attach']['name'][$key];
$mail->AddAttachment($source, $filename);
}
}//end Foreach loop
But when i try to attach a large file i get this error from the phpmailer class.
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate
7355049 bytes) in /var/www/dev01/maiarn/Email/class.phpmailer.php on line 1677
Any body who can guide me Please.