OJS version 3.3.0.11 installed not sending notification and emails to users

Description of issue or problem I’m having:
i have the latest OJS installed through cpanel, everytime a new article is submitted is returns error messages that email cannot be sent and i should contact the system administrator.

Steps I took leading up to the issue:

What I tried to resolve the issue:
i have contacted the hosting company and they said everything is working fine at their own end

Application Version - e.g., OJS 3.1.2:

OJS version 3.3.0.11

Additional information, such as screenshots and error log messages if applicable:
this is the error log from php mailer:
[20-Jun-2022 11:37:02 Africa/Lagos] ojs2: 404 Not Found
[20-Jun-2022 11:38:50 Africa/Lagos] PHP Warning: escapeshellcmd() has been disabled for security reasons in /home/njhstcom/journal.njhst.com.ng/lib/pkp/lib/vendor/phpmailer/phpmailer/src/PHPMailer.php on line 1729
[20-Jun-2022 11:38:50 Africa/Lagos] Could not instantiate mail function.
[20-Jun-2022 11:38:50 Africa/Lagos] Invalid address: (From): root@localhost

Hi @Amolowe2021

I’ve read your SMTP config section from the other thread and you could try adjusting the smtp_auth parameter from ssl to tsl as this user did:

Best,
Israel

thank you what i latter did is i got myself a third party SMTP provider Sendpulse to be precise and it works, originally webmail cant send more than 300 mails per month but with sendpulse i have 12000 mails per month, thanks

1 Like

Hi Israel. I’m using place as mentioned in the post. However, I have had no success so far. Additionally, I’ve completely reinstalled the server. This too did not fix the problem. Here is my set up.

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

; SMTP server settings
smtp_server = smtp.mailgun.org
smtp_port = 587
Enable SMTP authentication
; Supported smtp_auth: ssl, tls (see PHPMailer SMTPSecure)
 smtp_auth = tls
 smtp_username = "postmaster@DOMAIN"
 smtp_password = "KEY"
;
; Supported smtp_authtype: RAM-MD5, LOGIN, PLAIN, XOAUTH2 (see PHPMailer AuthType)
; (Leave blank to try them in that order)
; smtp_authtype =

; The following are required for smtp_authtype = XOAUTH2 (e.g. GMail OAuth)
; (See https://github.com/PHPMailer/PHPMailer/wiki/Using-Gmail-with-XOAUTH2)
; smtp_oauth_provider = Google
; smtp_oauth_email =
; smtp_oauth_clientid =
; smtp_oauth_clientsecret =
; smtp_oauth_refreshtoken =

; Enable suppressing verification of SMTP certificate in PHPMailer
; Note: this is not recommended per PHPMailer documentation
 smtp_suppress_cert_check = On

; Allow envelope sender to be specified
; (may not be possible with some server configurations)
allow_envelope_sender = On

; Default envelope sender to use if none is specified elsewhere
default_envelope_sender = postmaster@DOMAIN

; Force the default envelope sender (if present)
; This is useful if setting up a site-wide no-reply address
; The reply-to field will be set with the reply-to or from address.
 force_default_envelope_sender = On
; Force a DMARC compliant from header (RFC5322.From)
; If any of your users have email addresses in domains not under your control
; you may need to set this to be compliant with DMARC policies published by
; those 3rd party domains.
; Setting this will move the users address into the reply-to field and the
; from field wil be rewritten with the default_envelope_sender.
; To use this you must set force_default_enveloper_sender = On and
; default_envelope_sender must be set to a valid address in a domain you own.
 force_dmarc_compliant_from = On

; The display name to use with a DMARC compliant from header
; By default the DMARC compliant from will have an empty name but this can
; be changed by adding a text here.
; You can use '%n' to insert the users name from the original from header
; and '%s' to insert the localized sitename.
dmarc_compliant_from_displayname = '%n'

I have the same problem with both of my sites (3.3.0.4 and 3.3.0.14). It was not solved by changing the port or tsl
@israel.cefrin
@D_S

Hi @D_S

Have you checked your server log file? It might show further information to troubleshoot this issue. Given that you are using mailgun service, it would be advisable to confirm your OJS server is not being blocked as well.

Best,
Israel

Hi @juanivan92

Could you please check your server log file and check whether it shows any error message related to the mail service?

Best,
Israel

Hi @israel.cefrin
I get this problem
[31-May-2023 02:25:33 UTC] Could not instantiate mail function.

Hi @juanivan92

It usually means that the mail function on your PHP setting is disabled. Please, see the instructions to troubleshoot from this previous discussion:

Best,
Israel

Thank you @israel.cefrin
When I look at my php configuration I see this
disable_functions = exec,passthru,shell_exec,system,mail
Could the inclusion of “mail” be the source of my problem?

My mail log only shows SMTP connect() failed with no further information. At this point, I have even tried using sendmail as the relay. I have turned ufw off. Tried ping, dig, telnet. They all work. But sending fails. I guess I will have to wait for OJS 3.4. I am experimenting with a local install now.

Try this @D_S

Have you solved the problem? I am facing with same problem, I could not fine any solution.
In error is that :

PHP Warning: escapeshellcmd() has been disabled for security reasons in /home/endorest/public_html/lib/pkp/lib/vendor/phpmailer/phpmailer/src/PHPMailer.php on line 1729
Could not instantiate mail function.

I think version 3.4 fixes these issues. Try migration.

Hi @omerhtp,

Your host has disabled a function (escapeshellcmd) that’s required by OJS/OMP/OPS. Ask them to re-enable access to that function.

Regards,
Alec Smecher
Public Knowledge Project Team

I solved the problem bu changing the hosting. Thanks…

1 Like