OJS doesn't send e-mail

  • Application Version - I have two differents installations, OJS 3.1.2-4 (production) and 3.2.1-4 (test)

  • Description of issue

None of them are sending email

Settings are correct

; 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
  • Steps you took leading up to the issue

When any article is submitted, it does not send an email notification. A pink error message box appears.

  • What you tried to resolve the issue

I already checked the connection by telnet smtp.gmail.com 465 - So the connection was refused.
telnet smtp.gmail.com 587 - I have 220 return

  • Screenshots

Captura de tela de 2021-05-31 17-11-11

  • Error log messages if applicable

[Mon May 31 18:53:26.432988 2021] [php7:notice] [pid 5861] [client xxx.xxx.xxx.xxx:xxx] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting, referer:

By enabling the show_stacktrace = On directive located in the [debug] section of the config.inc.php file I found the problem.

We use CentOS 7 here. I don’t know why the httpd_can_sendmail directive was Off

By running the command setsebool -P httpd_can_sendmail 1, I solved the problem.

The most exotic thing about it is that it was enabled until last week… I don’t know what happened.

1 Like