0

When i put all code from testing server to live server., I got an error while sending email.

{ "message": "Network is unreachable", "url": "\/api\/users\/emailSheets", "code": 500, "file": "domainname.com/vendor\/cakephp\/cakephp\/src\/Network\/Socket.php", "line": 179 }

What is the problem on live server ?

In my app.php

'EmailTransport' => [
        'default' => [
            'className' => 'Mail',
            // The following keys are used in SMTP transports
            'host' => 'localhost',
            'port' => 25,
            'timeout' => 30,
            'username' => 'user',
            'password' => 'secret',
            'client' => null,
            'tls' => null,
            'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null),
        ],
        'gmail'=> [
          'host' => 'ssl://smtp.gmail.com',
          'port' => 465,
          'username' => 'my@gmail.com',  //your gmail address
          'password' => '123453',        //your gmail password
          'className' => 'Smtp',
          'log' => true,
          'context' => [
            'ssl' => [
                'verify_peer' => false,
                'verify_peer_name' => false,
                'allow_self_signed' => true
            ]
          ]
        ],
    ]
abhishek
  • 120
  • 10
  • Any chance a firewall is blocking it? That seems like the most obvious reason. – Greg Schmidt May 22 '18 at 14:51
  • Click [this](https://stackoverflow.com/questions/37982619/smtp-gmail-com-vs-ssl-smtp-gmail-com-while-sending-email-using-gmail-smtp-serv) link, it might be helpful to you. – Ajit Singh May 23 '18 at 04:45

0 Answers0