vendredi 9 mars 2018

Laravel Mail::queue Exception with message 'Allowed memory size of 268435456 bytes exhausted

In my laravel app I have created a helper for sending email.

Helper Code:

public static function send_email($page,$subject,$email,$email_data) {
      try {

        $site_url=url('/');

        $email_data['site_url'] = $site_url;

        Mail::queue($page, array('email_data' => $email_data), function ($message) use ($email, $subject) {
                $message->to($email)->subject($subject);
        });

        \Log::info("Email Sent ");

    } catch(\Exception $e) {

        \Log::info("Email Error ".print_r($e , true));

        return Helper::error_message(109);
    }
}

I was trying to update composer via composer update command after that my mail function stopped working and giving this exception error message:

[2018-03-09 11:21:22] local.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' 
with message 'Allowed memory size of 268435456 bytes exhausted 
(tried to allocate 252182528 bytes)' in /home/ubuntu/thumbtack-base/app/Helpers/Helper.php:708
Stack trace:
#0 {main} 

Whats wrong with my code?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2oWtx0L
via IFTTT

Aucun commentaire:

Enregistrer un commentaire