I'm getting this error when I try to call the mail() function.
I tried adding ini_set('memory_limit', '64m')
to my index.php file - Which include()'s all other files into that - But it didn't fix it.
I then tried adding a php.ini file into the root directory (where index.php resides) with the contents memory_limit = 64M
which then gave me PDO Class not found errors. So I added in the PDO extensions to the php.ini file and now all errors are gone.
However, the code still fails. phpinfo() shows the memory limit has been increased to 64M but my mail() function is killing the execution of the page.
How can I fix this? :/
Mail function
private static function emailPassword(SafeString $email, $password)
{
$subject = 'Registration';
$message = 'Your password is: ' . $password . "\n";
$headers = 'From: [email protected]' . "\r\n";
$headers .= 'Reply-to: [email protected]' . "\r\n";
$message = str_replace("\n.", "\n..", $message);
if (!mail($email->unsafeRaw(), $subject, $message, $headers))
{
throw new Exception('Failed');
}
}