dongmei8071 2018-11-29 10:20
浏览 51

使用Laravel 5.7电子邮件验证从代理网络中的服务器发送验证电子邮件

My problem is different from this , because i am getting this error due to proxy network. I am using laravel 5.7 built-in email verification. i have configure it in the following way.

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=mygmail@gmail.com
MAIL_PASSWORD=mypass
MAIL_ENCRYPTION=tls 

This configuration works fine when i am connected to a non proxy network. when i change to a proxy network i am getting the following error

"Connection could not be established with host smtp.gmail.com [php_network_getaddresses: getaddrinfo failed: No such host is known. #0]"

How can i fix this issue for a proxy network? i know my configuration is okay for non proxy network.

  • 写回答

1条回答 默认 最新

  • dongsi7067 2018-11-29 10:27
    关注

    You'll have to add something like this to your config/mail.php

       return [
          'components' => [
            'mailer' => [
              'transport' => [
                'streamOptions' => [ 
                  'ssl' => [ 
                    'allow_self_signed' => true,
                    'verify_peer' => false,
                    'verify_peer_name' => false,
                  ]
                ]
              ]
            ]
          ]
    
    ];
    
    评论

报告相同问题?

悬赏问题

  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器