[ SOLVED ] Problems to send mail (SMTP) on OJS

Well, first of all, sorry for post another question about send mails. But, after look for any solution here in this forum and Google, I decided to share this issue, cuz I am gonna crazy.

I simply can´t set up any way to send e-mail trought smpt auth in OJS I tried a lot of workarounds and nothing. So, I asked for my ISP support and them put a PHPMailer form, using SMTP on my host and… voilá… it´s working!

The strange part is because the ISP support used the same login, port and password that I am using in config.inc.php, but in my case it is not working.

I read a lot of posts here, tried a lot of solutions, but still not sending.

Please, if anyone have a light in the end of the tunnel, I will appreciate.

Thank you so much

Sistema Operacional Linux
Versão do PHP 7.1.13
Versão do Apache Apache
Driver da base de dados mysqli
Versão do servidor de base de dados 5.6.35-81.0-log
smtp Ativado
smtp_server smtp.myhostfortest.org.br
smtp_port 587
smtp_username noreply@myhostfortest.org.br
smtp_password pass
allow_envelope_sender Ativado
default_envelope_sender noreply@myhostfortest.org.br
force_default_envelope_sender Ativado
time_between_emails 3600
max_recipients 10
require_validation Ativado
validation_timeout 14

In your SMTP credentials, in config.inc.php, you should put something like:

smtp: On;
smtp_server: ssl://smtp.myhostfortest.org.br;

Note that for turning on the setting you should use On. Also, double check your SMTP port and ask the hosting provider for mail logs.

Thank you, Vitaliy for your help.

I did the changes described, but still not work.

I’ve checked with my host provider and the logs do not show any errors.

Smtp port is ok, cuz my provider did a test with a simple php form and we are able to send and receive e-mails.

I did try to send mail from OJS trought various smtp servers, including Google, Outlook, Yahoo and others commercial smtp. All failed.

I really do not understand where can be the issue in OJS that is blocking to send mails.


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

; SMTP server settings
smtp_server = ssl://smtp.myhostfortest.org.br
smtp_port = 587

; Enable SMTP authentication
; Supported mechanisms: ssl, tls
smtp_auth = ssl
smtp_username = noreply@myhostfortest.org.br
smtp_password = pass

; 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 = noreply@myhostfortest.org.br

; Force the default envelope sender (if present)
; This is useful if setting up a site-wide noreply address
; The reply-to field will be set with the reply-to or from address.
; force_default_envelope_sender = On

; 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-priveleged 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

I did a test using a SMTP server and I got this errors after 3 minutes trying to complete the request.

I’ve checked that this message aparently are comming from “class.smtp.php”

Is this message clear to someone?

DB Error: Lost connection to MySQL server during query
DB Error: MySQL server has gone away

Warning: Unknown: Cannot call session save handler in a recursive manner in Unknown on line 0

Warning: Unknown: Failed to write session data using user defined save handler. (session.save_path: ) in Unknown on line 0

I downgraded the php version to 5.6 and change MySQL driver to mysql.

|Versão do PHP|5.6.35|
|Driver da base de dados|mysql|

Still not working. I already did thousand of things. I can’t believe it is impossible to set up correctly the SMTP on OJS. All setup is fine, according instrucions and posts here in the forum. My ISP provider confirm that there are no error on logs.

I am almost giving up, cuz there are no information about this and I am ended my fonts to research


I solved this case.

I was not able to find the real problem with OJS SMTP files. I tried everything.

So, I decided a desperated action: copy “class.phpmailer.php”, “class.pop3.php” and “class.smtp.php” from my ISP provider solution over the OJS original files.

Well… its worked! :slight_smile:

I really do not know why original files are not working.

Sorry for not have a solution for OJS original files.

Thank you for help.


Dear Alex,
I have the same problem with you and tried of trying many things. I am not an IT guy and do not understand how your have copied ISP provider file.
Where can I find ISP provider corresponding files? and how should I ask for them. My hosting service does not support much and say that you have to cantact with OJS support.

Hi @baytan, which is your hosting provider?

Dear juanito,
Thank you for your interest. We use directnic for our journal.

Dear Alex,
I got same problem, and i couldnt solve it, yet. Please could you share your desperated files with us “class.phpmailer.php”, “class.pop3.php” and “class.smtp.php”

1 Like