Open jberanek opened 7 years ago
To enable email logging in MRBS set the following in your config,inc.php file:
$mail_settings['debug'] = true;
By default the messages will be sent to the PHP error log. If you want the messages to go to the browser, set
$mail_settings['debug_output'] = 'browser';
Original comment by: campbell-m
I searched for that setting, assuming it is currently set to false, but could not find it. I then added the first line of code to the MRBS config.inc.php file at the bottom of the file (below the company name), but the PHP error log showed no error. I then added the debug_output code line below the first one, but that gave no output to the browser. What should I do next?
Original comment by: pbritz
You won't get any output if MRBS thinks that it doesn't need to send email. You need to have at least one of the following settings set to true:
// WHO TO EMAIL
// ------------
// The following settings determine who should be emailed when a booking is made,
// edited or deleted (though the latter two events depend on the "When" settings below).
// Set to true or false as required
// (Note: the email addresses for the room and area administrators are set from the
// edit_area_room.php page in MRBS)
$mail_settings['admin_on_bookings'] = false; // the addresses defined by $mail_settings['recipients'] below
$mail_settings['area_admin_on_bookings'] = false; // the area administrator
$mail_settings['room_admin_on_bookings'] = false; // the room administrator
$mail_settings['booker'] = false; // the person making the booking
$mail_settings['book_admin_on_approval'] = false; // the booking administrator when booking approval is enabled
// (which is the MRBS admin, but this setting allows MRBS
// to be extended to have separate booking approvers)
Likewise you can control how much information is sent and what events trigger an email with the other $mail_settings options.
Original comment by: campbell-m
I got the following error on my browser: [DEBUG] Preparing email for new or changed booking ... [DEBUG] Preparing to send email ... [DEBUG] Using backend 'mail' [DEBUG] Recipients: {my email addres} Could not instantiate mail function. [DEBUG] Failed to send email: Could not instantiate mail function.
Original comment by: pbritz
From the debug messages it looks like you are using the 'mail' backend. If you want to use SMTP then you need to set
$mail_settings['admin_backend'] = 'smtp';
and then configure $smtp_settings appropriately. See systemdefaults.inc.php for more information.
Original comment by: campbell-m
I made the changes you mentioned and got the following error:
[DEBUG] Preparing email for new or changed booking ...
[DEBUG] Preparing to send email ...
[DEBUG] Using backend 'smtp'
[DEBUG] Recipients: {my email address}
Connection: opening to :25, timeout=300, options=array ()
Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): unable to connect to :25 (No connection could be made because the target machine actively refused it.)
SMTP ERROR: Failed to connect to server: No connection could be made because the target machine actively refused it. (10061)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
[DEBUG] Failed to send email: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
It seems that it is trying to connect to SMTP using port 25, however, I set it to use port 587, since that is what we use (with TLS):
$smtp_settings['host'] = 'za-smtp-outbound-1.mimecast.co.za'; // SMTP server
$smtp_settings['port'] = 587; // SMTP port number
$smtp_settings['auth'] = TRUE; // Whether to use SMTP authentication
$smtp_settings['secure'] = 'tls'; // Encryption method: '', 'tls' or 'ssl'
$smtp_settings['username'] = '{support email}'; // Username (if using authentication)
$smtp_settings['password'] = '{password}'; // Password (if using authentication)
$smtp_settings['disable_opportunistic_tls'] = false; // Set this to true to disable
Original comment by: pbritz
Are you sure that that config file was the one being used? I copied your settings and pasted them into my config file and got the following output:
Connection: opening to za-smtp-outbound-1.mimecast.co.za:587, timeout=300, options=array ( 'ssl' => array ( 'verify_peer' => true, 'verify_peer_name' => true, 'allow_self_signed' => false, ),)
Connection: opened
SERVER -> CLIENT: 220 za-smtp-1.mimecast.co.za ESMTP ; Tue, 21 Nov 2017 10:29:46 +0200
CLIENT -> SERVER: EHLO localhost
SERVER -> CLIENT: 250-za-smtp-1.mimecast.co.za Hello [84.9.75.124]250-AUTH LOGIN250-AUTH=LOGIN250-STARTTLS250 HELP
CLIENT -> SERVER: STARTTLS
SERVER -> CLIENT: 220 Starting TLS
CLIENT -> SERVER: EHLO localhost
SERVER -> CLIENT: 250-za-smtp-1.mimecast.co.za Hello [84.9.75.124]250-AUTH LOGIN250-AUTH=LOGIN250 HELP
CLIENT -> SERVER: AUTH LOGIN
SERVER -> CLIENT: 334 VXNlcm5hbWU6
CLIENT -> SERVER: e3N1cHBvcnQgZW1haWx9
SERVER -> CLIENT: 334 UGFzc3dvcmQ6
CLIENT -> SERVER: e3Bhc3N3b3JkfQ==
SERVER -> CLIENT: 535 Incorrect authentication data - https://community.mimecast.com/docs/DOC-1369#535
SMTP ERROR: Password command failed: 535 Incorrect authentication data - https://community.mimecast.com/docs/DOC-1369#535
SMTP Error: Could not authenticate.
CLIENT -> SERVER: QUIT
SERVER -> CLIENT:
SMTP ERROR: QUIT command failed:
Connection: closed
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
[DEBUG] Failed to send email: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Original comment by: campbell-m
I'm unsure what you mean by "that config file". I added the SMTP settings to the config.inc.php file.
Original comment by: pbritz
Ooops - I pasted the wrong output before. I have now edited the post above.
Original comment by: campbell-m
I meant that it seems, as you say, that it's using port 25 instead of 587. Having tested those config settings on my site, I can confirm that MRBS does indeed pick up the port number of 587. So my guess is that either
(a) the config.inc.php file that you added the settings to isn't the one being used by MRBS - possibly because it hasn't been uploaded or saved to the web folder; or (b) there's a later setting of $smtp_settings['port'] in the file which overrides the 587 one.
Original comment by: campbell-m
I have re-uploaded the file to the web folder, but it made no difference after restarting all the services. There is no other setting called $smtp_settings['port'] in the config.ini.php file. Should I be looking for $smtp_settings['port'] in another file as well?
Original comment by: pbritz
No, it shouldn't be in another file and you woulddn't need to restart all the services. You could add the following line at line 1127 of functions_mail.inc:
mail_debug("SMTP port: " . $smtp_settings['port']);
ie just after the line
mail_debug("Preparing to send email ...");
in the function sendMail(). That will tell you what port number it's telling phpMailer to use.
The other thing you could maybe do first is to make another change to your config file where the effects will be obvious, eg changing the database password, just to verify that you really are uploading the right file to the right place.
Original comment by: campbell-m
Here is the new error log:
[DEBUG] Preparing email for new or changed booking ...
[DEBUG] Preparing to send email ...
[DEBUG] SMTP port: 587
[DEBUG] Using backend 'smtp'
[DEBUG] Recipients: '{my email address}'
Connection: opening to :25, timeout=300, options=array ()
Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): unable to connect to :25 (No connection could be made because the target machine actively refused it.)
SMTP ERROR: Failed to connect to server: No connection could be made because the target machine actively refused it. (10061)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
[DEBUG] Failed to send email: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Original comment by: pbritz
Mmmm, that's interesting. It's definitely getting port 587 from the config and then trying to use 25. Can you post your full $mail_settings and $smtp_settings please from the config file, omitting anything sensitive like email addresses, usernames and passwords.
Original comment by: campbell-m
Please see below as requested. If you wish me to remove all the comments, I'll do it.
$mail_settings['debug'] = true;
$mail_settings['debug_output'] = 'browser';
// EMAIL - MISCELLANEOUS
// ---------------------
// Set the email address of the From field. Default is 'admin_email@your.org'
$mail_settings['from'] = '{support email address}';
// The address to be used for the ORGANIZER in an iCalendar event. Do not make
// this email address the same as the admin email address or the recipients
// email address because on some mail systems, eg IBM Domino, the iCalendar email
// notification is silently discarded if the organizer's email address is the same
// as the recipient's. On other systems you may get a "Meeting not found" message.
$mail_settings['organizer'] = '{My email address}';
// Set the recipient email. Default is 'admin_email@your.org'. You can define
// more than one recipient like this "john@doe.com,scott@tiger.com"
$mail_settings['recipients'] = '{My email address}';
// WHO TO EMAIL
// ------------
// The following settings determine who should be emailed when a booking is made,
// edited or deleted (though the latter two events depend on the "When" settings below).
// Set to true or false as required
// (Note: the email addresses for the room and area administrators are set from the
// edit_area_room.php page in MRBS)
$mail_settings['admin_on_bookings'] = true; // the addresses defined by $mail_settings['recipients'] below
$mail_settings['area_admin_on_bookings'] = true; // the area administrator
$mail_settings['room_admin_on_bookings'] = true; // the room administrator
$mail_settings['booker'] = true; // the person making the booking
$mail_settings['book_admin_on_approval'] = true; // the booking administrator when booking approval is enabled
// (which is the MRBS admin, but this setting allows MRBS
// to be extended to have separate booking approvers)
// WHEN TO EMAIL
// -------------
// These settings determine when an email should be sent.
// Set to TRUE or FALSE as required
//
// (Note: (a) the variables $mail_settings['admin_on_delete'] and
// $mail_settings['admin_all'], which were used in MRBS versions 1.4.5 and
// before are now deprecated. They are still supported for reasons of backward
// compatibility, but they may be withdrawn in the future. (b) the default
// value of $mail_settings['on_new'] is TRUE for compatibility with MRBS 1.4.5
// and before, where there was no explicit config setting, but mails were always sent
// for new bookings if there was somebody to send them to)
$mail_settings['on_new'] = TRUE; // when an entry is created
$mail_settings['on_change'] = FALSE; // when an entry is changed
$mail_settings['on_delete'] = FALSE; // when an entry is deleted
// It is also possible to allow all users or just admins to choose not to send an
// email when creating or editing a booking. This can be useful if an inconsequential
// change is being made, or many bookings are being made at the beginning of a term or season.
$mail_settings['allow_no_mail'] = TRUE;
$mail_settings['allow_admins_no_mail'] = FALSE; // Ignored if 'allow_no_mail' is TRUE
$mail_settings['no_mail_default'] = FALSE; // Default value for the 'no mail' checkbox.
// TRUE for checked (ie don't send mail),
// FALSE for unchecked (ie do send mail)
// WHAT TO EMAIL
// -------------
// These settings determine what should be included in the email
// Set to TRUE or FALSE as required
$mail_settings['details'] = TRUE; // Set to TRUE if you want full booking details;
// otherwise you just get a link to the entry
$mail_settings['html'] = TRUE; // Set to true if you want HTML mail
$mail_settings['icalendar'] = FALSE; // Set to TRUE to include iCalendar details
// which can be imported into a calendar. (Note:
// iCalendar details will not be sent for areas
// that use periods as there isn't a mapping between
// periods and time of day, so the calendar would not
// be able to import the booking)
// HOW TO EMAIL - BACKEND
// ----------------------
// Set the name of the backend used to transport your mails. Either 'mail',
// 'smtp', 'sendmail' or 'qmail'. Default is 'mail'.
$mail_settings['admin_backend'] = 'smtp';
/*******************
* SMTP settings
*/
// These settings are only used with the "smtp" backend
$smtp_settings['host'] = 'za-smtp-outbound-1.mimecast.co.za'; // SMTP server
$smtp_settings['port'] = 587; // SMTP port number
$smtp_settings['auth'] = TRUE; // Whether to use SMTP authentication
$smtp_settings['secure'] = 'tls'; // Encryption method: '', 'tls' or 'ssl'
$smtp_settings['username'] = '{support email address}'; // Username (if using authentication)
$smtp_settings['password'] = '{Password}'; // Password (if using authentication)
$smtp_settings['disable_opportunistic_tls'] = false; // Set this to true to disable
// opportunistic TLS
// https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting#opportunistic-tls
Original comment by: pbritz
Thanks. I tried those settings on my site and everything works OK, up until the point obviously when the username and password are rejected.
Can you try re-uploading lib/PHPMailer? If you're still getting the problem after that then we'll have to start putting some debugging in PHPMailer to find out why it's not getting the port number. Specifically, after line 1656 of lib/PHPMailer/class.phpmailer.php insert the lines
var_dump($port);
var_dump($tport);
Original comment by: campbell-m
I'm unsure what you mean by reuploading lib/PHPMailer. Do I copy the entire folder from the installation and replace it with the current folder? I went ahead and made the changes to the code. Here is a short extract of the area of code where I copied your two lines of code:
$host = $hostinfo[3];
$port = $this->Port;
$tport = (integer)$hostinfo[4];
var_dump($port);
var_dump($tport);
if ($tport > 0 and $tport < 65536) {
$port = $tport;
}
Here is the new output in the browser:
[DEBUG] Preparing email for new or changed booking ...
[DEBUG] Preparing to send email ...
[DEBUG] SMTP port: 587
[DEBUG] Using backend 'smtp'
[DEBUG] Recipients: '{my email address}'
C:\Bookings\web\lib\PHPMailer\class.phpmailer.php:1657:null
C:\Bookings\web\lib\PHPMailer\class.phpmailer.php:1658:int 0
Connection: opening to :25, timeout=300, options=array ()
Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): unable to connect to :25 (No connection could be made because the target machine actively refused it.)
SMTP ERROR: Failed to connect to server: No connection could be made because the target machine actively refused it. (10061)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
[DEBUG] Failed to send email: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Original comment by: pbritz
Yes, upload the entire folder from the MRBS 1.6.1 distribution, overwriting the current folder.
Original comment by: campbell-m
Done. It seems like it did not make a difference. Here is the browser output:
[DEBUG] Preparing email for new or changed booking ...
[DEBUG] Preparing to send email ...
[DEBUG] SMTP port: 587
[DEBUG] Using backend 'smtp'
[DEBUG] Recipients: '{My email address}'
Connection: opening to :25, timeout=300, options=array ()
Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): unable to connect to :25 (No connection could be made because the target machine actively refused it.)
SMTP ERROR: Failed to connect to server: No connection could be made because the target machine actively refused it. (10061)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
[DEBUG] Failed to send email: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Original comment by: pbritz
OK. Was just checking we've got the right PHPMailer code uploaded.
Can you add some more debugging in functions_mail.inc, by adding the following line at line 1350:
mail_debug(__LINE__ . ': $mail->Port: ' . $mail->Port);
Original comment by: campbell-m
Done. Here is the browser output:
[DEBUG] Preparing email for new or changed booking ...
[DEBUG] Preparing to send email ...
[DEBUG] SMTP port: 587
[DEBUG] 1350: $mail->Port:
[DEBUG] Using backend 'smtp'
[DEBUG] Recipients: '{My email address}'
Connection: opening to :25, timeout=300, options=array ()
Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): unable to connect to :25 (No connection could be made because the target machine actively refused it.)
SMTP ERROR: Failed to connect to server: No connection could be made because the target machine actively refused it. (10061)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
[DEBUG] Failed to send email: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Original comment by: pbritz
OK, we're getting closer. Can you add his line
mail_debug(__LINE__ . ': $mail->Port: ' . $mail->Port);
at line 1193.
Original comment by: campbell-m
New output:
[DEBUG] Preparing email for new or changed booking ...
[DEBUG] Preparing to send email ...
[DEBUG] SMTP port: 587
[DEBUG] 1193: $mail->Port:
[DEBUG] 1351: $mail->Port:
[DEBUG] Using backend 'smtp'
[DEBUG] Recipients: '{My email address}'
Connection: opening to :25, timeout=300, options=array ()
Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): unable to connect to :25 (No connection could be made because the target machine actively refused it.)
SMTP ERROR: Failed to connect to server: No connection could be made because the target machine actively refused it. (10061)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
[DEBUG] Failed to send email: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Original comment by: pbritz
OK, and at 1192 add
mail_debug("SMTP port: " . $smtp_settings['port']);
so that that section looks like this:
mail_debug("SMTP port: " . $smtp_settings['port']);
$mail->Port = $smtp_settings['port'];
mail_debug(__LINE__ . ': $mail->Port: ' . $mail->Port);
Original comment by: campbell-m
New output:
[DEBUG] Preparing email for new or changed booking ...
[DEBUG] Preparing to send email ...
[DEBUG] SMTP port: 587
[DEBUG] SMTP port: 587
[DEBUG] 1194: $mail->Port:
[DEBUG] 1352: $mail->Port:
[DEBUG] Using backend 'smtp'
[DEBUG] Recipients: '{My email address}'
Connection: opening to :25, timeout=300, options=array ()
Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): unable to connect to :25 (No connection could be made because the target machine actively refused it.)
SMTP ERROR: Failed to connect to server: No connection could be made because the target machine actively refused it. (10061)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
[DEBUG] Failed to send email: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Original comment by: pbritz
Well, I'm stumped! There's bound to be something blindingly obvious going wrong which I hope someone else can spot, but it seems that the line
$mail->Port = $smtp_settings['port'];
isn't doing what I'd expect it to do (and what it is doing properly on my system).
It's a very long shot, but I'll try running it on PHP 5.6.31.
Original comment by: campbell-m
It is already running at 5.6.31. The WAMP software gives me the option of chosing between 5.6.31 , 7.0.23 and 7.1.9. Should I pick one of the version 7's? EDIT: Fixed a typing error in the version number.
Original comment by: pbritz
Yes, I meant I'll switch my system to 5.6.31. But you could try switching to one of the 7's as well.
Original comment by: campbell-m
Works OK on 5.6.31 for me.
Original comment by: campbell-m
Damn. I tried both version 7's and both gave me the same error output.
Original comment by: pbritz
I've no idea what's going wrong. I'm going to take a break and have a think about it.
Original comment by: campbell-m
Ok. I also thought of installing the newer version of MRBS, but I will have to do some research on how to do that correctly.
Original comment by: pbritz
It would be worth doing that anyway, as it fixes a number of issues. I have just realised that I was actually testing with the newest version of MRBS, but I don't think that's the difference as nothing has changed in those areas. But just to be sure I'll test against 1.6.1.
Original comment by: campbell-m
This is the output I get in 1.6.1 (without the extra debug lines):
[DEBUG] Preparing email for new or changed booking ...
[DEBUG] Preparing to send email ...
[DEBUG] Using backend 'smtp'
[DEBUG] Recipients: {my email addresses}
Connection: opening to za-smtp-outbound-1.mimecast.co.za:587, timeout=300, options=array ()
Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): unable to connect to za-smtp-outbound-1.mimecast.co.za:587 (Connection refused)
SMTP ERROR: Failed to connect to server: Connection refused (111)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
[DEBUG] Failed to send email: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Slightly different output, which reminds me that some things have changed, but it's getting the correct port number. Yes, I think upgrading to 1.7.0 is definitely the next step.
Original comment by: campbell-m
Just to say that as I was looking at the area anyway I've updated the version of PHPMailer used in the default branch of MRBS to be the latest code from the 5.2-stable branch. I don't for a moment think that this is the cause of the problems being seen here as the old PHPMailer code worked fine for me. It just seemed that it had been a while since we had updated the MRBS PHPMailer code and it was a good time to do it.
Original comment by: campbell-m
Just to eliminate some more differences I also tried it using MRBS 1.6.1 on Wampserver 3.1.0 as you have - previously I was using IIS - and everything works OK. So I have no idea what could be going wrong. Output below:
[DEBUG] Preparing email for new or changed booking ...
[DEBUG] Preparing to send email ...
[DEBUG] SMTP port: 587
Invalid address: (setFrom)
[DEBUG] 1350: $mail-Port: 587
[DEBUG] Using backend 'smtp'
[DEBUG] Recipients: '[snipped]'
Connection: opening to za-smtp-outbound-1.mimecast.co.za:587, timeout=300, options=array ()
Connection: opened
SERVER -> CLIENT: 220 za-smtp-1.mimecast.co.za ESMTP ; Wed, 22 Nov 2017 00:17:35 +0200
CLIENT -> SERVER: EHLO localhost
SERVER -> CLIENT: 250-za-smtp-1.mimecast.co.za Hello [84.9.75.124]250-AUTH LOGIN250-AUTH=LOGIN250-STARTTLS250 HELP
CLIENT -> SERVER: STARTTLS
SERVER -> CLIENT: 220 Starting TLS
CLIENT -> SERVER: EHLO localhost
SERVER -> CLIENT: 250-za-smtp-1.mimecast.co.za Hello [84.9.75.124]250-AUTH LOGIN250-AUTH=LOGIN250 HELP
CLIENT -> SERVER: AUTH LOGIN
SERVER -> CLIENT: 334 VXNlcm5hbWU6
CLIENT -> SERVER: e3N1cHBvcnQgZW1haWwgYWRkcmVzc30=
SERVER -> CLIENT: 334 UGFzc3dvcmQ6
CLIENT -> SERVER: e1Bhc3N3b3JkfQ==
SERVER -> CLIENT: 535 Incorrect authentication data - https://community.mimecast.com/docs/DOC-1369#535
SMTP ERROR: Password command failed: 535 Incorrect authentication data - https://community.mimecast.com/docs/DOC-1369#535
SMTP Error: Could not authenticate.
CLIENT -> SERVER: QUIT
SERVER -> CLIENT:
SMTP ERROR: QUIT command failed:
Connection: closed
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
[DEBUG] Failed to send email: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Original comment by: campbell-m
The only thing I can think is that the Visual C++ libraries on your PC are out of date and that this is somehow causing a weird PHP bug. See http://wampserver.aviatechno.net/?lang=en&prerequis=afficher.
But I'm clutching at straws here.
Original comment by: campbell-m
Just to be clear. You are refering to the computer where the software is hosted, right? That is our Windows Server 2012 R2. I'm downloading the new version of MRBS now.
Original comment by: pbritz
Yes, sorry, I meant your Windows Server when I was talking about the Visual C++ libraries.
Original comment by: campbell-m
I have installed Visual C++ 2017 version 14.11.25325 now. No difference. I installed the new version of MRBS and got the same output:
[DEBUG] Preparing email for new or changed booking ...
[DEBUG] Preparing to send email ...
[DEBUG] SMTP port: 587
[DEBUG] SMTP port: 587
[DEBUG] 1194: $mail->Port:
[DEBUG] 1352: $mail->Port:
[DEBUG] Using backend 'smtp'
[DEBUG] Recipients: 'pbritz@odm.org.za'
Connection: opening to :25, timeout=300, options=array ()
Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): unable to connect to :25 (No connection could be made because the target machine actively refused it.)
SMTP ERROR: Failed to connect to server: No connection could be made because the target machine actively refused it. (10061)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
[DEBUG] Failed to send email: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
I have copied config.inc.php, class.phpmailer.php and functions_mail.inc from the previous version of MRBS. Should I start with a clean slate and re-setup these files?
Original comment by: pbritz
You can keep the config.inc.php file from the previous version, but best to start with a clean slate for the others. No need to add in the debugging information as we know what's going wrong.
The WAMPserver notes seem to say that you have to have the latest versions of all the Visual C++ libraries, both 32 and 64 bit (if you are using a 64 bit machine). Here's a screenshot attached of the versions that I have (taken from Control Panel). It's the only thing that I can think of that could be different between your system and my system. I admit it's a long shot though as you would have thought that any problems would surface in many more places.
Also, the notes said that you have to have the latest versions installed before installing WAMPserver, so you may need to remove and reinstall WAMPserver.
Original comment by: campbell-m
I have updated all the Visual C++ versions and installed one or two missing ones (32bit ones). I reinstalled WAMP after that. Emails are now being sent. Thank you. I noticed that I'm getting all the mails. Here is some background info on how I'm using the system: We have a room "Training Room". On the system it is set up as an "area". In this area I have "rooms" called coffee, projector, etc. The purpose of this is so that the people responsible for setting up the projector, gets an email to notify them. Same goes for "coffee", etc. I'm getting email for "coffee", as well as the other "room" options, even though I'm only suppose to get projector. I also noticed that when an entry is deleted or modified, I'm not getting the mail. I have made the following email address related changes to config.inc.php:
$mail_settings['from'] = '{support email}';
$mail_settings['organizer'] = '{system user email}';
$mail_settings['recipients'] = '{Projector email address},{coffee email address},{whiteboard email address}';
Original comment by: pbritz
Excellent! I am glad it's working: that bug was puzzling!
The addresses in 'recipients' get all emails. You need to put the coffee and projector people in as room_admin email addresses. Login as an admin, go to the Rooms page, select the Training Room area and edit the various rooms. There's also an area admin email field that you will see if you edit the area. They get all notifications to do with that area.
To get notifications when a booking is modified or deleted, set
$mail_settings['on_change'] = true; // when an entry is changed
$mail_settings['on_delete'] = true; // when an entry is deleted
There's another way of doing what you want to do. Instead of having rooms for coffee etc, make the training room a room instead of an area and then use custom fields. The disadvantage of this method is that you'll need to make a few changes to the MRBS code to get individual emails. See https://sourceforge.net/p/mrbs/support-requests/1344/.
Original comment by: campbell-m
Thank you very much for the help. I'm busy having a look at the change you suggested and will follow up if I cant figure something out.
Original comment by: pbritz
Good day I'm have set up the MRBS system and it is functioning. I'm able to log in and create rooms/entries. I am struggling with the email setup. I have set it up as discribed in online tutorials, but the mail does not get delivered. I have created a SMTP relay on the server running MRBS and it is working correctly, but MRBS does not seem to be "talking" to it. I have tried finding the email log files to see if what the possible error is, but to no avail. Where are they located?
I am running WAMPserver 3.1.0 64bit The following is copied from the WAMP program Apache 2.4.27 - PHP 5.6.31 MySQL 5.7.19 MariaDB 10.2.8 PHP 5.6.31 for CLI (Command-Line Interface)
The following is copied from the help section of MRBS: Meeting Room Booking System: MRBS 1.6.1 Database: MySQL 5.7.19 System: Windows NT WSUS 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64 Server time: 11/20/2017 11:52:07 AM PHP: 5.6.31
Thank you
Reported by: pbritz
Original Ticket: mrbs/support-requests/1362