0

I am getting the following error in sending emails in laravel 5.4.36 I have applied the options mentioned in previous questions asked by different user but i am still unable to find solution

stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number

I am using this setting in mail.php in config

return [

    'driver' => env('MAIL_DRIVER', 'smtp'),
    'host' => env('MAIL_HOST', 'smtp.gmail.com'),
    'port' => env('MAIL_PORT', 587),
    'from' => [
        'address' => env('MAIL_FROM_ADDRESS', 'hello@domain.com'),
        'name' => env('MAIL_FROM_NAME', 'domain Schools'),
    ],
    'encryption' => env('MAIL_ENCRYPTION', 'tls'),
    'username' => 'hello@domain.com',
    'password' => 'mypassword',
    'sendmail' => '/usr/sbin/sendmail -bs',
    'markdown' => [
        'theme' => 'default',

        'paths' => [
            resource_path('views/vendor/mail'),
        ],
    ],
   'stream' => [
   'ssl' => [
      'allow_self_signed' => true,
      'verify_peer' => false,
      'verify_peer_name' => false,
   ],
  ],

];

and following setting in env file

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=hello@domain.com
MAIL_PASSWORD=mypassword
MAIL_ENCRYPTION=tls 
Bilal Rabbi
  • 1,602
  • 2
  • 18
  • 39

1 Answers1

1

I resolved this by using MAIL_ENCRYPTION as ssl and port 465

Bilal Rabbi
  • 1,602
  • 2
  • 18
  • 39