Jorani v1.0.0 gives PHP error when sending with SMTP(O365)

321 views
Skip to first unread message

B Marton

unread,
Mar 26, 2021, 5:46:00 AM3/26/21
to jorani
Hi All,

I'm receiving this PHP error after creating a leave request (I receiving the mail, but user see a long log on screen)
I'm using the original SMTP.php from zip, haven't modified.
Using Ubuntu 20.04 tried with php 7.1 7.2 7.4 (same problem)

.....
2021-03-26 09:42:06 CLIENT -> SERVER: QUIT
2021-03-26 09:42:06 SERVER -> CLIENT: 221 2.0.0 Service closing transmission channel
2021-03-26 09:42:06 Connection: closed
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /var/www/html/jorani/vendor/phpmailer/phpmailer/src/SMTP.php:277)

Filename: helpers/url_helper.php

Line Number: 564

smtp.png


Thanks!

B Marton

unread,
Mar 26, 2021, 8:17:14 AM3/26/21
to jorani
added error_reporting(0);

not good, but it's working :)

Patrik

unread,
Jan 20, 2022, 5:05:43 AM1/20/22
to jorani

Hello All,

I have the same issue everytime mails are sent via SMTP. Everything works, mails are also working, but I always receive an warning A PHP Error was encountered and it's annoying. This is visible after User creation, password reset, Leave request and so on.

Is there any solution to this? I saw from reply above that error_reporting(0); can fix this, but it wasn't specified where this line should be put. And PHP is not my strongest side, so I didn't try it yet. I tried everything else that was suggested in this group, but no luck. I would really appreciate any help on this.

This is what I have: Apache/2.4.46 (Win64), PHP/7.4.10 and Jorani/v.1.0.0


Thanks in advance :)

 

Kind regards,

Patrik

Nicolas Bruneau

unread,
Feb 24, 2022, 4:49:00 AM2/24/22
to jorani
I have something very similar.

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /var/www/html/jorani/vendor/phpmailer/phpmailer/src/SMTP.php:280)

Filename: helpers/url_helper.php

Line Number: 564


Nicolas Bruneau

unread,
Nov 28, 2022, 6:06:31 AM11/28/22
to jorani
Bonjour à tous,

J'ai toujours cette erreur lorsqu'un email est envoyé : 
-----------------------------------------------------------------------------------------------------------------
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /var/www/html/jorani/vendor/phpmailer/phpmailer/src/SMTP.php:280)

Filename: helpers/url_helper.php

Line Number: 564

--------------------------------------------------------------------------------------------------------------------

Je confirme que le mail est bien envoyé.

Je suis en version 1.0.0 de Jorani.

Merci de votre aide.



Philippe Mignon

unread,
Nov 28, 2022, 11:52:38 AM11/28/22
to jorani
Hello
I think (not sure) that the functionnality /vendor/phpmailer is deprecated with PHP and disapear in the evolution of Jorani since v1.0.0 master
The solution i've found in front of this minor error is to download new files via Github
But I can't help you how to know what files are needed for this error, certainly a change in the phphmailer library.
The right code can be found in one of the commits since last release https://github.com/bbalet/jorani/compare/v1.0.0...master

Nicolas Bruneau

unread,
Nov 29, 2022, 2:19:38 AM11/29/22
to jor...@googlegroups.com
Hi Philippe,

Thanks for your insight. Unfortunately, I'm not developper and therefore do not have the skills to do that.
But does it mean that everybody has the error when Jorani is sending an email ?

Thanks for any help and have a good day.

Bruneau Nicolas
nbru...@gmail.com


--
You received this message because you are subscribed to the Google Groups "jorani" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jorani+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jorani/75d7ad76-2539-4db4-9d32-7e313fe4f93cn%40googlegroups.com.

Philippe Mignon

unread,
Nov 29, 2022, 4:42:58 AM11/29/22
to jorani
Hi,
Once again, really not sure but it seem's the problem is with PHPmailer function.
If it, it can be resolved from this work of Benjamin Balet: ER:Migrate to PHPMailer 6 and stop to ship it · bbalet/jorani@175e885 (github.com)
In this comit, Benjamin moved the PHPmailer function from Jorani\application\third_party\phpmailer\ to Jorani\vendor\

And it seems that this code had now to be download separatly to be compatible with evolution of your server (version of PHP of your server)
Then replace with new files in your directory Jorani\vendor\phpmailer\phpmailer\

I'm not a developper too, it would be great if someone could confirm if I'm right or if this comment had to be ignored 😬
Have a good day
Philippe Mignon

Jon Wright

unread,
Dec 9, 2022, 2:53:04 AM12/9/22
to jorani
I found that setting 
$config['smtp_debug']       = 0;  

in application/config/email.php
fixed the problem for me (jorani latest git code version with phpmailer updated to 6.7 but I think just setting debug was all it needed)

-- as an additional, we wanted to get rid of the 'Send me my password' button and found it was quite simple (assuming we have broken anything else or missed the correct way of doing it)
in application/config/config.php 
add this line at the bottom:
$config['remove_forget_password'] = TRUE; // disable asking for new password via email

in application/views/session/login.php make this change
97c97
<     <?php if (($this->config->item('ldap_enabled') == FALSE) && (ENVIRONMENT!='demo')) { ?>
---
>     <?php if (($this->config->item('ldap_enabled') == FALSE) && (ENVIRONMENT=='demo') && ($this->config->item('remove_forget_password') == FALSE)) { ?>

Hope someone finds this useful.

Jon Wright

unread,
Dec 9, 2022, 4:15:45 AM12/9/22
to jorani
For sending email from a 'gmail account' via gmail smtp we found we needed to do this In our google account, 

Settings, Security, turn on 2 factor signing in verification
Then in 'app passwords' -> select app -> mail,  select device 'Other / Jorani' -> generate
This gave us a 16 character password:
Our gmail settings in application/config/email.php then became:

$config['useragent']        = 'PHPMailer';              
$config['protocol']         = 'smtp';                  
$config['mailpath']         = '/usr/sbin/sendmail';
$config['smtp_host']        = 'ssl://smtp.gmail.com';
$config['smtp_auth']        = TRUE;                   
$config['smtp_user']        = USER...@gmail.com';
$config['smtp_pass']        = '16_char_password';
$config['smtp_port']        = 465;
$config['smtp_timeout']     = 30;                     
$config['smtp_crypto']      = 'SSL';               
$config['smtp_debug']       = 0;                      
$config['smtp_auto_tls']    = FALSE;                 

and this worked for us.
Reply all
Reply to author
Forward
0 new messages