Laravel5.1 use a queue to send emails
First in '. the queue driver "QUEUE_DRIVER = database" laravel5.1 in the env file provides six drivers: 'sync', 'databse', 'beancalkd ', 'sqs', and 'Iron ', for details about 'redis ', refer to the official manual. in this example, the 'database' driver php cli is used to run "php artisan queue: tablephp artisan queue: failed-tablephp artisan migrate" to generate two tables, store the successful data and failed data of the queue and then in 'app/config/mail. set the sender's account and name in php' from '=> ['address' => 'XXX @ 163.com ', 'name' => 'fucket'] 'in '. "MAIL_DRIVER = smtpMAIL_HOST = smtp.163.comMAIL _ PORT = 25MAIL_USERNAME = email account MAIL_PASSWORD = email password MAIL_ENCRYPTION = null" _ confirm that your mailbox has enabled the SMTP service _ configure the send Route "Route:: get ('mail/queue ', function () {mail: later (5, 'emails. queued_email ', ["name" => "gewenrui"], function ($ message) {$ message-> to ('recipient mailbox', 'name ') -> subject ('theme ');}); return "get emails ";}); "Run 'php artisan queue: listen' under the new php cli template under 'Views/emails/queue 'to access the 'mail/queue' route. you can find 'processed: mailer @ handleQueuedMessage 'sent successfully