Office 365 - Email.php

172 views
Skip to first unread message

Simon Utley

unread,
Aug 1, 2017, 5:23:11 AM8/1/17
to jorani
Hi Benjamin,

Love the software and i nearly have it implemented in my company.

I just can't get email.php to work with Office 365! When i run testmail.php with my settings it fails and i have been through it all and still won't work. Can you suggest anything?

Merci beaucoup!

Benjamin BALET

unread,
Aug 1, 2017, 5:32:13 AM8/1/17
to jor...@googlegroups.com
1 - Did you follow the suggestions given into testmail.php (i.e. valid from_mail, etc.) ?
2 - What is the output of the script ?

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to jor...@googlegroups.com.
Visit this group at https://groups.google.com/group/jorani.
To view this discussion on the web visit https://groups.google.com/d/msgid/jorani/2549eed2-194d-47ff-bfc3-6dddedbd6a7d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Simon Utley

unread,
Aug 1, 2017, 7:58:24 AM8/1/17
to jorani
1. yes - i have used my own email address to test. this is fully licensed with a mailbox.
2. see attached. i have made sure all send emails/username are a vaild 365 mailbox.
email error.txt

Benjamin BALET

unread,
Aug 1, 2017, 8:07:28 AM8/1/17
to jor...@googlegroups.com
ERROR: The configuration doesn't exist.

It means that the file email.php wasn't found.
It can be into application/folder or one of the subfolder if you set CI_ENV into .htacces file.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to jor...@googlegroups.com.
Visit this group at https://groups.google.com/group/jorani.

Simon Utley

unread,
Aug 1, 2017, 9:09:00 AM8/1/17
to jorani
i have set ENV to htaccess rebooted and tested the file testmail.php and i still get the same error?

Is there a different file that i am supposed to edit?


On Tuesday, 1 August 2017 13:07:28 UTC+1, Benjamin BALET wrote:
ERROR: The configuration doesn't exist.

It means that the file email.php wasn't found.
It can be into application/folder or one of the subfolder if you set CI_ENV into .htacces file.
2017-08-01 13:58 GMT+02:00 Simon Utley <simon....@gmail.com>:
1. yes - i have used my own email address to test. this is fully licensed with a mailbox.
2. see attached. i have made sure all send emails/username are a vaild 365 mailbox.

On Tuesday, 1 August 2017 10:23:11 UTC+1, Simon Utley wrote:
Hi Benjamin,

Love the software and i nearly have it implemented in my company.

I just can't get email.php to work with Office 365! When i run testmail.php with my settings it fails and i have been through it all and still won't work. Can you suggest anything?

Merci beaucoup!

--
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 post to this group, send email to jor...@googlegroups.com.
Visit this group at https://groups.google.com/group/jorani.

Benjamin BALET

unread,
Aug 1, 2017, 9:30:52 AM8/1/17
to jor...@googlegroups.com
The constant ENV doesn't exists, so I assume you are speaking about CI_ENV
You are not supposed to change CI_ENV except if you are working with many environments.
Jorani expect to find a file application/config/email.php (except if you change CI_ENV. Then it is supposed to be into a subfolder according to CI_ENV).

Please check all the file names ; either email.php or config.php is not found.

To unsubscribe from this group and stop receiving emails from it, send an email to jorani+unsubscribe@googlegroups.com.

To post to this group, send email to jor...@googlegroups.com.
Visit this group at https://groups.google.com/group/jorani.

Simon Utley

unread,
Aug 1, 2017, 10:44:29 AM8/1/17
to jorani
Yes i was talking about CI_ENV. This line - define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development');

It is now set back to default and i have not moved email.php from /var/www/html/""/application/config/email.php.

Testmail.php is at top level where it should be.

config/config.php is setup correctly.

Can you suggest anything? Permissions to the folder? i am on v0.6.2 brand new install.

Benjamin BALET

unread,
Aug 1, 2017, 10:47:23 AM8/1/17
to jor...@googlegroups.com
What is the version of PHP ?

To unsubscribe from this group and stop receiving emails from it, send an email to jorani+unsubscribe@googlegroups.com.

To post to this group, send email to jor...@googlegroups.com.
Visit this group at https://groups.google.com/group/jorani.

Simon Utley

unread,
Aug 1, 2017, 10:55:54 AM8/1/17
to jorani
php 7.0.18
ubuntu 17.04.1
mysql 14.14 dist 5.7.19

Benjamin BALET

unread,
Aug 2, 2017, 4:14:49 AM8/2/17
to jor...@googlegroups.com
As far as I understand, you are trying to use this script from the command line.
This is a bad idea because you are not into the same context than the web application (at least, the php.ini differs).
Please use the script directly from your browser as it is intended (e.g. https://demo.jorani.org/testmail.php).

To unsubscribe from this group and stop receiving emails from it, send an email to jorani+unsubscribe@googlegroups.com.

To post to this group, send email to jor...@googlegroups.com.
Visit this group at https://groups.google.com/group/jorani.

Simon Utley

unread,
Aug 2, 2017, 6:04:10 AM8/2/17
to jorani
I have done that and as soon as i go to the requirements page it is blank! When i remove the vaild email address the troubleshooting page comes back. Can you tell me which files need to be edited and the lines so i can put the relevant info in?

Something in the config can't be right - i have searched but i am getting nowhere. I can telnet to office 365 from my server so there can't be a problem.

Benjamin BALET

unread,
Aug 2, 2017, 6:13:40 AM8/2/17
to jor...@googlegroups.com
If any of the diagnostic pages becomes blank, it means that something is mal formed into the configuration files.
Sometimes it's due to copy/pasting an illegal character such as a quotation mark which is similar but different than ' or " (or that the beginning or end mark is missing).
If I understand you well, this happens when you copy/paste the email address (I don't know if you are talking about the testing address or the from_email), maybe that it contains an illegal character.
Anyway, your server log files (i.e. apache error log) should tell you the file and the line number where the error occurs.


To unsubscribe from this group and stop receiving emails from it, send an email to jorani+unsubscribe@googlegroups.com.

To post to this group, send email to jor...@googlegroups.com.
Visit this group at https://groups.google.com/group/jorani.

Simon Utley

unread,
Aug 2, 2017, 7:08:04 AM8/2/17
to jorani
thank you for this.

I have been through the logs and it refers to - PHP Fatal error:  Cannot use temporary expression in write context in /var/www/html/"  "/application/config/email.php line 2 but, it is correct!

Benjamin BALET

unread,
Aug 2, 2017, 7:17:42 AM8/2/17
to jor...@googlegroups.com
I don't understand what's happening to you.
The only solution I see is to send me the files email.php and testmail.php to my email address (benjami...@gmail.com).

To unsubscribe from this group and stop receiving emails from it, send an email to jorani+unsubscribe@googlegroups.com.

To post to this group, send email to jor...@googlegroups.com.
Visit this group at https://groups.google.com/group/jorani.

Yoann LEROSIER

unread,
Aug 3, 2017, 3:14:44 AM8/3/17
to jorani
I've got the same issue and i renamed : 

application/third_party/phpmailer

into

application/third_party/PHPMailer

and in application/config/email.php, i used :

$config['useragent']        = 'PHPMailer';

If it can help you :)

Simon Utley

unread,
Aug 3, 2017, 5:23:50 AM8/3/17
to jorani
Thank you Yoann - i was following your post thinking you may have the same issue. I will let you know how it goes as i have started again because of other issues.

Simon Utley

unread,
Aug 3, 2017, 2:23:31 PM8/3/17
to jorani
Hi Yoann -  i made the changes you spoke about and this did work for sending the test mail but, i now can't receive a reset password email or request etc.

I had to change the the below files to fall n line with your changes you suggested

                // No? Search for autoloader at some fixed places.
                if (!$phpmailer_class_exists && defined('COMMONPATH')) {

                    $autoloader = COMMONPATH.'third_party/PHPMailer/PHPMailerAutoload.php';
                    @ include_once $autoloader;
                    $phpmailer_class_exists = class_exists('PHPMailer', true);
                }

                if (!$phpmailer_class_exists) {

                    $autoloader = APPPATH.'third_party/PHPMailer/PHPMailerAutoload.php';
                    @ include_once $autoloader;
                    $phpmailer_class_exists = class_exists('PHPMailer', true);

No error logs now but, im baffled!

Yoann LEROSIER

unread,
Aug 4, 2017, 5:40:09 AM8/4/17
to jorani
Yes, you're right. I made this change also but I forgot to tell you.

You must do it in MY_Email.php file.

Simon Utley

unread,
Aug 4, 2017, 7:18:36 AM8/4/17
to jorani
Hi Yoann,

i have made this change and i receive no emails from the system only the test feature. When i reset a users password via the email function i receive no email but the system tells me that it has sent. It doesn't get stuck in spam etc.

Any ideas?

Yoann LEROSIER

unread,
Aug 4, 2017, 8:16:34 AM8/4/17
to jorani
Hi,

I don't use this fonction because of my LDAP configuration. Did you receive email from the workflow ?

Simon Utley

unread,
Aug 4, 2017, 8:26:21 AM8/4/17
to jorani
ça marche!!!

I took the same approach you suggested in your topic and also inserted a rely on my local server. Works a treat now! :D

Merci beacoup Yoann :)

Yoann LEROSIER

unread,
Aug 4, 2017, 9:00:09 AM8/4/17
to jorani
You're welcome / de rien.
Reply all
Reply to author
Forward
0 new messages