小编Sam*_*Ali的帖子

laravel 5.4:从localhost发送电子邮件不起作用

我想用laravel 5.4发送我本地主机的电子邮件.它向我显示以下错误:错误的 屏幕截图

这是我的.env文件

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=myemail@gmail.com
MAIL_PASSWORD=mypassword
MAIL_ENCRYPTION=tfl
Run Code Online (Sandbox Code Playgroud)

这是我的mail.php文件

<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Mail Driver
    |--------------------------------------------------------------------------
    |
    | Laravel supports both SMTP and PHP's "mail" function as drivers for the
    | sending of e-mail. You may specify which one you're using throughout
    | your application here. By default, Laravel is setup for SMTP mail.
    |
    | Supported: "smtp", "sendmail", "mailgun", "mandrill", "ses",
    |            "sparkpost", "log", "array"
    |
    */

    'driver' => env('MAIL_DRIVER', 'mail'),

    /*
    |--------------------------------------------------------------------------
    | SMTP …
Run Code Online (Sandbox Code Playgroud)

php email laravel laravel-5 laravel-5.3

5
推荐指数
1
解决办法
2万
查看次数

标签 统计

email ×1

laravel ×1

laravel-5 ×1

laravel-5.3 ×1

php ×1