OJS Mail configuration

email]

; Default method to send emails
; Available options: sendmail, smtp, log, phpmailer
default = sendmail

; Path to the sendmail, -bs argument is for using SMTP protocol
sendmail_path = “/usr/sbin/sendmail -bs”

; 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 smtp_auth: ssl, tls (see PHPMailer SMTPSecure)
; smtp_auth = ssl
; smtp_username = mygmail address

; smtp_password = my mail password

Mail service is not operational through above settings in OJS 3.5

try this setting

[email]

; Default method to send emails
; Available options: sendmail, smtp, log, phpmailer
default = smtp

; Path to the sendmail, -bs argument is for using SMTP protocol
;sendmail_path = "/usr/sbin/sendmail -bs"

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

; SMTP server settings. put port 587 for tls if 465 ssl is not working
smtp_server = smtp.gmail.com
smtp_port = 465

; Enable SMTP authentication
; Supported smtp_auth: ssl, tls (see PHPMailer SMTPSecure)
smtp_auth = ssl
smtp_username = username@gmail.com
smtp_password = yourapppasswordherenotyourgmailpassword

; Enable suppressing SSL/TLS peer verification by SMTP transports
; Note: this is not recommended for security reasons
; 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 = username@gmail.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 = 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 via %s'

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

; The number of days a user has to validate their account before their access key expires.
validation_timeout = 14

default = smtp

it gives HTML 500 error

I litterally use this setting other than i use 587 and tls and its working fine on my server.

Maybe you can give the php error log for the 500 error.

Try the solution here if the error is same for you

Check the proc_open for php. If its disable, enable it and restart the server.

Check here