[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-06 20:32:09
|
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. |