How to send emails with Phpmailer on localhost without module ssl

Asked

Viewed 216 times

-2

Hello folks would like to know if there is a possibility to send email localhost using the Phpmailer library without having to install the SSL module in apache and PHP? I have tried several techniques but so far for all SSL is required installed.

  • 3

    Hello Jose, welcome! Please separate the question and the solution. Put the solution as the answer by clicking the button below to answer.

  • 2

    I am voting to close this question as out of scope because this is not a question, it is a post, it does not match with the purpose of the OS.

  • Topic changed to fit the scope

  • On this site we do not add SOLVED in the title. If the question was not closed, the correct would be to post the solution and then accept it.

  • I was able to respond. It’s just that while I was in the lurch the reply option was disabled.

Show 1 more comment

1 answer

0

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

To be able to send email with phpmailer locally, simply edit the file 'class.smtp.php' and right 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

enter the code:

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

hope I’ve helped!!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.