OJS not sending emails

Describe the issue or problem
We had a fresh installation of OJS 3.3.0.8. with the following email settings:

[email]

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

; SMTP server settings
; smtp_server = localhost
; smtp_port = 26

; Enable SMTP authentication
; Supported smtp_auth: ssl, tls (see PHPMailer SMTPSecure)
; smtp_auth = none
; smtp_username = email@mydomain.com
; smtp_password = *********
;
; 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 Using Gmail with XOAUTH2 · PHPMailer/PHPMailer Wiki · GitHub)
; 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 = Off

; Default envelope sender to use if none is specified elsewhere
; default_envelope_sender = my_address@my_host.com

; 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 = Off

; 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 = Off

; 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 via %s’

; Amount of time required between attempts to send non-editorial emails
; in seconds. This can be used to help prevent email relaying via OJS.
time_between_emails = 3600

; Maximum number of recipients that can be included in a single email
; (either as To:, Cc:, or Bcc: addresses) for a non-privileged user
max_recipients = 10

; If enabled, email addresses must be validated before login is possible.
require_validation = on

; Maximum number of days before an unvalidated account expires and is deleted
validation_timeout = 14

Steps I took leading up to the issue

But it is not sending email. i created a test user and try to login but since it is not sending email so i had to manually enable that user and to validate my settings i sent email but it result in fail with the following error:
Uncaught Error: Call to undefined function PHPMailer\PHPMailer\mail() in /home/journalo/public_html/lib/pkp/lib/vendor/phpmailer/phpmailer/src/PHPMailer.php:868
Stack trace:
#0 /home/journalo/public_html/lib/pkp/lib/vendor/phpmailer/phpmailer/src/PHPMailer.php(1827): PHPMailer\PHPMailer\PHPMailer->mailPassthru(‘test2 test2 <in…’, ‘Test email 2’, ‘This is a multi…’, ‘Date: Tue, 21 F…’, ‘-finfo@journalo…’)
#1 /home/journalo/public_html/lib/pkp/lib/vendor/phpmailer/phpmailer/src/PHPMailer.php(1611): PHPMailer\PHPMailer\PHPMailer->mailSend(‘Date: Tue, 21 F…’, ‘This is a multi…’)
#2 /home/journalo/public_html/lib/pkp/lib/vendor/phpmailer/phpmailer/src/PHPMailer.php(1442): PHPMailer\PHPMailer\PHPMailer->postSend()
#3 /home/journalo/public_html/lib/pkp/classes/mail/Mail.inc.php(592): PHPMailer\PHPMailer\PHPMailer->send()
#4 /home/journalo/public_html/lib/pkp/classes/mail/MailTemplate.inc.php(212): Mail->send()
#5 /home/journalo/public_html/lib/pkp/controllers/grid/settings/user/form/UserEmailForm.inc.php(87): MailTemplate->send()
#6 /home/journalo/public_html/lib/pkp/controllers/grid/settings/user/UserGridHandler.inc.php(529): UserEmailForm->execute()
#7 /home/journalo/public_html/lib/pkp/classes/core/PKPRouter.inc.php(395): UserGridHandler->sendEmail(Array, Object(Request))
#8 /home/journalo/public_html/lib/pkp/classes/core/PKPComponentRouter.inc.php(257): PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(Request), Array)
#9 /home/journalo/public_html/lib/pkp/classes/core/Dispatcher.inc.php(144): PKPComponentRouter->route(Object(Request))
#10 /home/journalo/public_html/lib/pkp/classes/core/PKPApplication.inc.php(362): Dispatcher->dispatch(Object(Request))
#11 /home/journalo/public_html/index.php(68): PKPApplication->execute()
#12 {main}
thrown in /home/journalo/public_html/lib/pkp/lib/vendor/phpmailer/phpmailer/src/PHPMailer.php on line 868

What application are you using?
OJS 3.3.0.8.

Additional information
Uncaught Error: Call to undefined function PHPMailer\PHPMailer\mail() in /home/journalo/public_html/lib/pkp/lib/vendor/phpmailer/phpmailer/src/PHPMailer.php:868
Stack trace:
#0 /home/journalo/public_html/lib/pkp/lib/vendor/phpmailer/phpmailer/src/PHPMailer.php(1827): PHPMailer\PHPMailer\PHPMailer->mailPassthru(‘test2 test2 <in…’, ‘Test email 2’, ‘This is a multi…’, ‘Date: Tue, 21 F…’, ‘-finfo@journalo…’)
#1 /home/journalo/public_html/lib/pkp/lib/vendor/phpmailer/phpmailer/src/PHPMailer.php(1611): PHPMailer\PHPMailer\PHPMailer->mailSend(‘Date: Tue, 21 F…’, ‘This is a multi…’)
#2 /home/journalo/public_html/lib/pkp/lib/vendor/phpmailer/phpmailer/src/PHPMailer.php(1442): PHPMailer\PHPMailer\PHPMailer->postSend()
#3 /home/journalo/public_html/lib/pkp/classes/mail/Mail.inc.php(592): PHPMailer\PHPMailer\PHPMailer->send()
#4 /home/journalo/public_html/lib/pkp/classes/mail/MailTemplate.inc.php(212): Mail->send()
#5 /home/journalo/public_html/lib/pkp/controllers/grid/settings/user/form/UserEmailForm.inc.php(87): MailTemplate->send()
#6 /home/journalo/public_html/lib/pkp/controllers/grid/settings/user/UserGridHandler.inc.php(529): UserEmailForm->execute()
#7 /home/journalo/public_html/lib/pkp/classes/core/PKPRouter.inc.php(395): UserGridHandler->sendEmail(Array, Object(Request))
#8 /home/journalo/public_html/lib/pkp/classes/core/PKPComponentRouter.inc.php(257): PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(Request), Array)
#9 /home/journalo/public_html/lib/pkp/classes/core/Dispatcher.inc.php(144): PKPComponentRouter->route(Object(Request))
#10 /home/journalo/public_html/lib/pkp/classes/core/PKPApplication.inc.php(362): Dispatcher->dispatch(Object(Request))
#11 /home/journalo/public_html/index.php(68): PKPApplication->execute()
#12 {main}
thrown in /home/journalo/public_html/lib/pkp/lib/vendor/phpmailer/phpmailer/src/PHPMailer.php on line 868

What application are you using?
OJS 3.3.0.8.

Hi @KMC,

Looks like a number of your configuration settings are still contain the ; - have you tried adjusting these? Also, have you tried some of the troubleshooting options noted here: https://docs.pkp.sfu.ca/admin-guide/en/email#troubleshooting-email-problems

-Roger
PKP Team

Ohhh God… i forgot to remove the ; during installation.
I removed them now and its working fine.

Thanks alot

1 Like

This topic was automatically closed after 4 days. New replies are no longer allowed.