2

I have laravel 5.2 with mamp pro in my mac. I work localhost, and i try to send email to mailtrap but is not work i have this error

Maximum function nesting level of '100' reached, aborting!

my .env

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=MyuserName
MAIL_PASSWORD=MyPassword
MAIL_ENCRYPTION=null

in my controller

Mail::send('emails.test', ['user' => 'test'], function ($m) {
        $m->from('from@example.com', 'Your Application');

        $m->to('from@example.com')->subject('Your Reminder!');
    });
john
  • 468
  • 1
  • 9
  • 26
  • Possible duplicate of [Solution for "Fatal error: Maximum function nesting level of '100' reached, aborting!" in PHP](http://stackoverflow.com/questions/8656089/solution-for-fatal-error-maximum-function-nesting-level-of-100-reached-abor) – CodeBrauer Nov 15 '16 at 16:19

3 Answers3

0

Try by adding the following code in bootstrap/autoload.php file. It increases the xdebug.max_nesting_level to 200.

ini_set('xdebug.max_nesting_level', 200);

If this doesn't solve then try to increase the level by 300 or 400.

Amit Gupta
  • 17,072
  • 4
  • 41
  • 53
0

If you adjust your php.ini file to something like 200, this will cure the issue

[xdebug]
xdebug.max_nesting_level = 200

Hope this helps!

Saumya Rastogi
  • 13,159
  • 5
  • 42
  • 45
0

.env File:-

MAIL_DRIVER=mail

app/mail.php File:-

'driver' => 'mail'

Controller file:-

Mail::send('emails.test', ['user' => 'test'], function ($m) {

    $m->from('from@example.com', 'Your Application');

    $m->to('from@example.com')->subject('Your Reminder!');
});