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 maccms影视模板 制作影视网站失败 求
  • ¥15 stm32按键设置闹钟数进退位不正常
  • ¥15 三电平逆变器中点电位平衡问题
  • ¥20 这怎么写啊 java课设
  • ¥15 用C语言完成一个复杂的游戏
  • ¥15 如何批量更改很多个文件夹里的文件名中包含文件夹名?
  • ¥50 MTK手机模拟HID鼠标出现卡顿
  • ¥20 求下下面这个数据结构代码
  • ¥20 前端 二进制文件流图片转化异常
  • ¥15 github上的这个C语言项目如何跑起来