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 init i2c:2 freq:100000[MAIXPY]: find ov2640[MAIXPY]: find ov sensor是main文件哪里有问题吗
  • ¥15 运动想象脑电信号数据集.vhdr
  • ¥15 三因素重复测量数据R语句编写,不存在交互作用
  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景