How to send emails with PHPmailer in localhost without module ssl

-2
Hello everyone, would you like to know if there is a possibility to send localhost emails using the PHPmailer library without having to install the SSL module in Apache and PHP? I've tried a lot of techniques but until now for all you need SSL installed.

    
asked by anonymous 31.01.2017 / 06:37

1 answer

0

In the end, I was able to send email with the phpmailer class, in localhost, without the need to install ssl on the machine. This tip was tested now in January 2017.

In order to send mail with phpmailer locally, just edit the file ' class.smtp.php ' and, just after the line:

public function connect($host, $port = null, $timeout = 30, $options = array()){
static $streamok;
    //This is enabled by default since 5.0.0 but some providers disable it
    //Check this once and cache the result

Insert the code:

if (count($options) == 0){
  $options['ssl'] = array('verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true);
}

I hope to have helped !!

    
01.02.2017 / 18:14