Laravel mail pretend prints nothing

后端 未结 5 446
走了就别回头了
走了就别回头了 2021-02-01 16:48

I set \'pretend\' => true, in the mail.php, created this new.php view:


    
E-mail: {{
5条回答
  •  余生分开走
    2021-02-01 17:14

    If you actually want to view the contents of the message (for instance when testing user account verification or password reset emails) in the /storage/logs logfile; You can modify your local copy of vendor/laravel/framework/src/Illuminate/Mail/Mailer.php and in the logMessages function modify it to look like

    protected function logMessage($message)
    {
        $emails = implode(', ', array_keys((array) $message->getTo()));
        $body = $message->getBody();
        $this->logger->info("Pretending to mail message to: {$emails} :-: {$body}");
    }
    

    Then you will see the body of the message in the logs.

提交回复
热议问题