0
votes

I've been using Moodle 3.10.1 and configuring outgoing mail server with there parameters: SMTP hosts: smtp.gmail.com:465

SMTP security: SSL

SMTP username: my email address @gmail.com

SMTP password: my password for the above email account

but after test out email configuration, Moodle return these errors:

**2021-03-01 08:49:30 Connection: opening to ssl://smtp.gmail.com:465, timeout=300, options=array()

2021-03-01 08:49:30 Connection failed. Error #2: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed [D:\wamp64\www\myweb\lib\phpmailer\src\SMTP.php line 344]

2021-03-01 08:49:30 Connection failed. Error #2: stream_socket_client(): Failed to enable crypto [D:\wamp64\www\myweb\lib\phpmailer\src\SMTP.php line 344]

2021-03-01 08:49:30 Connection failed. Error #2: stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Unknown error) [D:\wamp64\www\myweb\lib\phpmailer\src\SMTP.php line 344]

2021-03-01 08:49:30 SMTP ERROR: Failed to connect to server: (0) 2021-03-01 08:49:30 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting**

Please help me to fix error. Thank in advance.

1

1 Answers

0
votes

Have you logged into https://account.google.com and:

  1. Click on [Security] menu
  2. Scroll to section [Less secure app access] and set it to ON
  3. Scroll to section [Signing in to Google] and set [Use your phone to sign in] to OFF
  4. Scroll to section [Signing in to Google] and set [2-step Verification] to OFF