OJS 3.1.2-4 not sending any email

I’ve installed OJS 3.1 and configured Gmail as smtp, but the system can not send emails.
can someone help-me?
configuration as below:
//============================================================//
config.inc.php - [email]

; Use SMTP for sending mail instead of mail()
smtp = On

; SMTP server settings
smtp_server = smtp.gmail.com
smtp_port = 465

; Enable SMTP authentication
; Supported mechanisms: ssl, tls
smtp_auth = ssl
smtp_username = “xxxx.xxx@gmail.com
smtp_password = “xxxxxxxxxxxxx”
//============================================================//
php.ini configuration
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = me@example.com

; For Unix only. You may supply arguments as well (default: “sendmail -t -i”).
; http://php.net/sendmail-path
sendmail_path = /usr/sbin/sendmail -t -i
//============================================================//

Server Information

|OS platform|Linux|
|PHP version|7.2.24-0ubuntu0.18.04.2|
|Apache version|Apache/2.4.29 (Ubuntu)|
|Database driver|mysqli|
|Database server version|5.7.29-0ubuntu0.18.04.1|
//============================================================//
Sendmal is up and running
When you send a letter from the terminal comes

sudo php -r “mail(‘xxxxxxxx@gmail.com’, ‘Test letter from your site’, ‘Hey. This is a test post.’);”

error.log
SMTP connect() failed. Troubleshooting · PHPMailer/PHPMailer Wiki · GitHub, referer: http://atcs.com/index.php/atcs/management/settings/access

The first thing I’d check is to see if you can actually connect to port 465 on the Gmail SMTP server. From a command line:

telnet smtp.gmail.com 465

And see if you can connect. If that times out, then you may have to adjust a firewall or talk to your ISP. If it does work, we can look at different things.

Cheers,
Jason

@jnugent Hello! Yes, I first checked the connection via smtp on the terminal. Connects normally.

Hey @Aznur

I was doing some reading and one suggested possibility is to use TLS instead of SSL, and use port 587

https://support.cloudways.com/configure-gmail-smtp/

Cheers,
Jason

And, since you’re already looking at the PHPMailer debugging info, you can add this line to lib/pkp/classes/mail/Mail.inc.php

            $mailer->SMTPDebug = SMTP::DEBUG_CONNECTION;

Right after this line:

            $mailer = new \PHPMailer\PHPMailer\PHPMailer();

in the send() method.

That should dump out fair amount of debugging information.

Cheers,
Jason

@jnugent Hello! I used TLS instead of SSL and it worked. Thanks a lot!