dtg7662 2018-06-14 09:55
浏览 117
已采纳

Laravel在旁边代理网络中发送邮件

I am just implementing like password reset system. The Sending Mail system is working in home without the proxy setup. But inside the proxy setup system is not working(both are in localhost). when i upload to the server its working. Then why in the localhost under the proxy setup network system is not working???

It shows the Error

Expected response code 220 but got code "421", with message "421 Cannot connect to SMTP server 74.125.200.109 (74.125.200.109:587), connect error 10060 "

This is my .env

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=test@gmail.com
MAIL_PASSWORD=*********
MAIL_ENCRYPTION=tls

my config/mail.php

return [
    'driver' => env('MAIL_DRIVER', 'smtp'),
    'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
    'port' => env('MAIL_PORT', 587),
    'from' => [
        'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
        'name' => env('MAIL_FROM_NAME', 'MYNAME'),
    ],
    'encryption' => env('MAIL_ENCRYPTION', 'tls'),
    'username' => env('MAIL_USERNAME'),
    'password' => env('MAIL_PASSWORD'),
    'sendmail' => '/usr/sbin/sendmail -bs',
    'markdown' => [
        'theme' => 'default',
        'paths' => [
            resource_path('views/vendor/mail'),
        ],
    ],
];

Since i am new to laravel , Is there any setting need to do OR Should i want to configure the proxy name and port number(how to configure the proxy setup in laravel) ... please help me .. thank you in advance

  • 写回答

1条回答 默认 最新

  • dongzhao1865 2018-06-14 16:11
    关注

    When you want use your gmail account in another apps, You should enable Let less secure apps option

    Also you can define another key for your account ( different that you account password ). You should have a key like this when you are using 2FA

    Don't forget to run php artisan config:cache after any changes in .env file

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 关于#python#的问题:自动化测试