Re: [Phpmailer-general] Newbie: Filesize > 1.5MB = "Could not instantiate function"
A full-featured email creation and transfer class for PHP
Brought to you by:
coolbru
From: James B. <stu...@gm...> - 2014-02-07 00:06:09
|
SOLVED Imagine that! The answer here, as in other places, is to adjust the maximum message size ... in the SMTP program. Here's how I did it with Microsoft IIS7 SMTP: 1) You MUST use IIS6 Manager to adjust your SMTP settings ... even though it is included with IIS7 (as an extension from the Exchange team, not the MS web server team), IIS7 does not have any mechanism to do adjust it! Brilliant, MS! 2) Open IIS6 Manager 3) In the left column: Select the system you are modifying 4) In the right column: See "[SMTP Virtual Server #1] => Running" 5) Right-click "[SMTP Virtual.." and select "Properties" 6) Under the "Messages" tab, check the value of "Limit message size to (KB):" Mine was set to 2048. 7) Increase that value to what you need. I went up to 20MB (20480 KB) 8) Also increase the value of "Limit session size to (KB):" so it is larger than "message size". I went to 40MB (40960 KB). Bingo. Thanks for your thoughts, Chris. On Thu, Feb 6, 2014 at 1:28 PM, Chris Weiss <cw...@gm...> wrote: > I'm not sure what "600000000M" will do, since it expects an integer > value that's too large for an integer, and part of the docs say the > "M" notation is ONLY for php.ini. if you really want no limit, use > -1. > > 128M should be plenty though, so it's not that. > > On Thu, Feb 6, 2014 at 3:13 PM, James Butler <stu...@gm...> > wrote: > > In php.ini: > > > > memory_limit = 128M > > > > In the script: > > > > ini_set('memory_limit','600000000M'); > > > > > > > > > > On Thu, Feb 6, 2014 at 12:45 PM, Chris Weiss <cw...@gm...> wrote: > >> > >> what are your php memory settings? you need at least (the file > >> size+10%)*2 plus whatever your other code needs > >> > >> On Thu, Feb 6, 2014 at 2:32 PM, James Butler <stu...@gm...> > >> wrote: > >> > Windows IIS7 > >> > PHP v.5.4 > >> > PHPMailer v.5.2.2 > >> > > >> > Sending messages with attachments < 1.5MB works just fine. > >> > > >> > Sending message with attachment > 1.5MB produces error: > >> > > >> > "Could not instantiate mail function." > >> > > >> > File IS uploaded and available for attachment. > >> > > >> > Here's an expanded error message: > >> > > >> > start============== > >> > phpMailerException: Could not instantiate mail function. > >> > > >> > print_r(error_get_last()) used to get: > >> > > >> > Array ( [type] => 2 [message] => mail(): Failed to Send [file] => > >> > \Path\to\PHPMailer\class.phpmailer.php [line] => 447 ) > >> > > >> > File info: uploads/test.docx : size: 2333.6083984375 > >> > end============== > >> > > >> > Here is class.phpmailer.php lines 443-450: > >> > > >> > start============== > >> > private function mail_passthru($to, $subject, $body, $header, > $params) > >> > { > >> > if ( ini_get('safe_mode') || !($this->UseSendmailOptions) ) { > >> > $rt = @mail($to, > >> > $this->EncodeHeader($this->SecureHeader($subject)), > >> > $body, $header); > >> > } else { > >> > 447=> $rt = @mail($to, > >> > $this->EncodeHeader($this->SecureHeader($subject)), $body, $header, > >> > $params); > >> > } > >> > return $rt; > >> > } > >> > end============== > >> > > >> > My php.ini specifies (and phpinfo() shows) both post_max_size and > >> > upload_max_filesize = 20M > >> > > >> > My upload form contains MAX_FILE_SIZE of 41943040 > >> > > >> > I have included ini_set commands to extend the execution and input > times > >> > of > >> > the script to 25 minutes (the send process takes less than 3 seconds > >> > even > >> > with a big attachment). > >> > > >> > I have tried using mb_encode_mimeheader() instead of > >> > EncodeHeader(..SecureHeader()..) as suggested on the web. > >> > > >> > Almost all of the suggestions I have found online talk about updating > >> > the > >> > *Nix mail program (postfix, sendmail, etc.) to allow longer send > times, > >> > but > >> > obviously I'm running Windows. > >> > > >> > I'm at a loss as to where to find more detailed error messages, or > what > >> > else > >> > to try. > >> > > >> > I'm sorry if I missed an obvious answer, somewhere. Any thoughts? > >> > > >> > To reiterate: Only errors with attached file size > 1.5MB. Smaller > >> > attachments work very well. > >> > > >> > TIA. > >> > > >> > > >> > > ------------------------------------------------------------------------------ > >> > Managing the Performance of Cloud-Based Applications > >> > Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. > >> > Read the Whitepaper. > >> > > >> > > http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk > >> > _______________________________________________ > >> > Phpmailer-general mailing list > >> > Php...@li... > >> > https://lists.sourceforge.net/lists/listinfo/phpmailer-general > >> > > > > > > > > > > ------------------------------------------------------------------------------ > > Managing the Performance of Cloud-Based Applications > > Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. > > Read the Whitepaper. > > > http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk > > _______________________________________________ > > Phpmailer-general mailing list > > Php...@li... > > https://lists.sourceforge.net/lists/listinfo/phpmailer-general > > > |