Email Sending Problem after Upgrade to 3.3

Re: Email Sending Problem after Upgrade to 3.3

by Marco Cuellar -
Number of replies: 0

sanaz karimkhani

I solved it.

Using moodle 3.3 and Gmail.

I have been dealing whit this problem for a wile, I tryed whit a hotmail address and it works whit no problem, but gmail it was a big problem for me.

What I did?

Well, first  I go to my install path: C:\inetpub\wwwroot\moodle3.3\lib\phpmailer

And I make a copy of the file class.smtp.php.

and add two lines of code at line 255 approximately, it looks like this:

_____________________________________________________________________________________________________

 public function connect($host, $port = null, $timeout = 30, $options = array())
    {
          if(count($options)==0){
      $options["ssl"]=array("verify_peer"=>false,"verify_peer_name"=>false,"allow_self_signed"=>true);
   }

__________________________________________________________________________________________________

and second:

go to this link https://myaccount.google.com/device-activity?hl=en&pli=1

and view recent attempts to use the account and accept suspicious access.

(If you don´t use google You don´t have to do this).

I dont know if it is the best thing to do, because the phpmailer is looking for a certificate on local host and I disable the ssl check whit this, but at least now I can send emails.

credits for this guys:

http://punto50.blogspot.com/2015/03/envio-de-correo-con-phpmailer-y-gmail.html

https://stackoverflow.com/questions/21937586/phpmailer-smtp-error-password-command-failed-when-send-mail-from-my-server


I hove this can help some one else. (sorry for my bad English)


Happy New year 2018 to all of you!