Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7748109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:41:54+00:00 2026-06-01T10:41:54+00:00

I have made a php page that sends an email message with multiple attachments.

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T10:41:55+00:00Added an answer on June 1, 2026 at 10:41 am

    You might want to increase the PHP memory limit. If you’re working on your development machine, you could search for the php.ini file and modify the memory_limit (which often defaults to 16M). Change that to f.e. 128M and restart your webserver.

    If you want to see it change, you can use the following line to show the configuration currently in use:

    <?php phpinfo(); ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am not very used to php, but I have made an index.php page
I have a registration.php page I made and I need to check if a
My permalink structure is set so I have url.com/page I made a basic PHP
I have made a form that accepts query and executes it through php. I
I have made a game which is nearly identical to Popcap's Atomica. ( http://www.popcap.com/gamepopup.php?theGame=atomica
I have a page, index.php, that shows information based on a mysql db. There
I have made a tiny ModX snippet that looks like this <?php $theMenu =
I have made a Web page using jquery and php where all files are
I made a PHP page that looks up Constant Contact e-mail addresses in a
I have a PHP page that needs to make a call to a external

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.