0

Here, I am using the magepal SMTP Extension.

https://github.com/magepal/magento2-gmail-smtp-app

This is Through the Error Could Not Open Socket

https://drive.google.com/file/d/1ufNUzil1IthL_OTUQTeMU9_R5bsyj80D/view?usp=sharing

Config. Setting :
 Gmail SMTP server address: smtp.gmail.com
 Gmail SMTP username: Gmail address 
 Gmail SMTP password: Gmail password
 Gmail SMTP port (SSL): 25

2 Answers 2

0

You need to try this.

open this file : vendor\magento\zendframework1\library\Zend\Mail\Protocol\Abstract.php

arround line no 267.

$this->_socket = @stream_socket_client($remote, $errorNum, $errorStr, self::TIMEOUT_CONNECTION);

comment above line and add this code below that line.

$stream_context = stream_context_create(array(
 'ssl' => array(
  'verify_peer'       => false,
  'verify_peer_name'  => false,
  'allow_self_signed' => true
  )
 ));
$this->_socket = stream_socket_client(
  $remote, 
  $errorNum, 
  $errorStr, 
  self::TIMEOUT_CONNECTION, 
  STREAM_CLIENT_CONNECT, 
  $stream_context 
 );
1
  • I am already try this but it doesn't work
    – user82717
    Sep 9, 2019 at 8:40
0

SMTP Installation For Magento - 2

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.