Php 流明:不发送电子邮件';t工作(超过30秒的最大执行时间)

Php 流明:不发送电子邮件';t工作(超过30秒的最大执行时间),php,laravel,email,lumen,Php,Laravel,Email,Lumen,我想在拉威尔·鲁门上发电子邮件。我的控制器是: $data = array('name'=>"test"); Mail::send('emails.confirmation', $data, function($message) { $message->to('xxx.xxx@xx.fr', 'xxx')->subject ('Laravel HTML Testing Mail');

我想在拉威尔·鲁门上发电子邮件。我的控制器是:

$data = array('name'=>"test");
        Mail::send('emails.confirmation', $data, function($message) {
            $message->to('xxx.xxx@xx.fr', 'xxx')->subject
            ('Laravel HTML Testing Mail');
            $message->from('xx@xxx.fr','Virat Gandhi');
        });
return "HTML Email Sent. Check your inbox.";
我有一个包含两行HTML的简单视图

但是,当我进入页面(为了发送邮件)时,我的代码中没有错误,但是: 超过了30秒的最大执行时间

这个错误来自Mail方法,但我真的不明白为什么,用这个简单的代码。。它应该很好用


请帮帮我,我从几小时前开始(

首先。在您的情况下,最好使用队列。Laravel文档中描述如何发送确认电子邮件的基本队列示例。
第二步。你确定你正确配置了邮件驱动程序吗?你能在这里提供你的env文件和日志文件吗?(当然没有任何私人数据(密码、机密、登录)

谢谢你,我要检查队列。这是我的.env文件(我使用自定义smtp服务器):

我将
MAIL\u DRIVER
设置为“log”,以便在不发送真实电子邮件的情况下进行测试

我设置邮件驱动程序的步骤是:

(安装/邮寄)

  • 将这一行
    $app->register(illumb\Mail\MailServiceProvider::class);
    添加到app.php

  • 将下面的行添加到app.php

    $app->configure('mail'); $app->alias('mailer',light\Mail\mailer::class); $app->alias('mailer',illumb\Contracts\Mail\mailer::class); $app->alias('mailer',illumb\Contracts\Mail\MailQueue::class)

  • /config/mail.php中创建一个新的mail.php文件,如下所示

  • 设置.env变量

  • 这是我的日志文件:

    [2020-11-12 17:18:23] local.ERROR: Maximum execution time of 30 seconds exceeded {"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\FatalError(code: 0): Maximum execution time of 30 seconds exceeded at D:\\Dev\\GiftListAPI\\vendor\\swiftmailer\\swiftmailer\\lib\\classes\\Swift\\Transport\\StreamBuffer.php:162)
    [stacktrace]
    #0 {main}
    "} 
    

    我已经解决了我的问题:问题在于我的凭据。我将localhost置于主机上并禁用tls(我的webmail服务器与我的网站位于同一服务器上)。 我真的不明白为什么我没有明显的错误

    [2020-11-12 17:18:23] local.ERROR: Maximum execution time of 30 seconds exceeded {"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\FatalError(code: 0): Maximum execution time of 30 seconds exceeded at D:\\Dev\\GiftListAPI\\vendor\\swiftmailer\\swiftmailer\\lib\\classes\\Swift\\Transport\\StreamBuffer.php:162)
    [stacktrace]
    #0 {main}
    "}