I have a script that sends an email at the end of work. At some point, stop sending messages with an error:
Could not instantiate mail function
No changes in the script or in the system settings have been made. The only thing that has changed - increased memory consumption and execution time as the increased volume of data being processed.
Could error associated with memory? If I try to send a message at the beginning of the script, everything works.
EDIT: The same code works at the beginning of the script and is doesn't work at the end.
require_once 'class_phpmailer.php';
$phpmail = new PHPMailer();
$phpmail->CharSet = 'UTF-8';
$phpmail->Sender = "my@site.com";
$phpmail->From = "my@site.com";
$phpmail->FromName = "mysite";
$phpmail->AddAddress('another@site.com');
$phpmail->Subject = 'test';
$phpmail->MsgHTML('test');
if( !$phpmail->Send() ){
echo $phpmail->ErrorInfo ;
}