meeting-room-booking-system / mrbs-code

MRBS application code
Other
120 stars 58 forks source link

Version 1.6.0 email notifications do not work any more #1883

Open jberanek opened 7 years ago

jberanek commented 7 years ago

[Transferred from the general mailing list]

After I upgraded to version 1.6.0 my email notifications have stopped working..Here is my relevant section…worked fine in previous version up to the point of upgrade.

/**********************************************
* Email settings
**********************************************/
$mail_settings['admin_on_bookings']      = TRUE;
$mail_settings['area_admin_on_bookings'] = TRUE;
$mail_settings['room_admin_on_bookings'] = TRUE;
$mail_settings['booker']                 = TRUE;
$mail_settings['book_admin_on_approval'] = FALSE; 
$mail_settings['on_new']    = TRUE;
$mail_settings['on_change'] = TRUE;
$mail_settings['on_delete'] = TRUE;
$mail_settings['details']   = TRUE;
$mail_settings['html']      = TRUE;
$mail_settings['icalendar'] = FALSE;
$mail_settings['admin_lang'] = 'en';
$mail_settings['admin_backend'] = 'smtp';
$smtp_settings['host'] = 'smtp.xx.xx';  // SMTP server
$smtp_settings['port'] = 25;           // SMTP port number
$smtp_settings['auth'] = FALSE;        // Whether to use SMTP authentication
$smtp_settings['username'] = '';       // Username (if using authentication)
$smtp_settings['password'] = '';       // Password (if using authentication)
$mail_settings['disabled'] = FALSE;
$mail_settings['from'] = 'mrbs@xxxx.xx';
$mail_settings['recipients'] = 'xxxxx@xxxx.xx';
//$mail_settings['debug'] = TRUE;

Reported by: campbell-m

Original Ticket: mrbs/support-requests/1163

jberanek commented 7 years ago

Can you try setting

$mail_settings['debug'] = true;

By default the debug output will go to the error log. If you want it to go to the browser then you will need to set:

$mail_settings['debug_output'] = 'browser';

Original comment by: campbell-m

jberanek commented 7 years ago

[DEBUG] Preparing email for new or changed booking ... [DEBUG] Preparing to send email ... [DEBUG] Using backend 'smtp' [DEBUG] Recipients: 'givaz@bcit.ca,libcirc@bcit.ca,Goran_Ivaz@bcit.ca' Connection: opening to smtp.bcit.ca:25, timeout=300, options=array () Connection: opened SERVER -> CLIENT: 220 ex2013-01.ad.bcit.ca Microsoft ESMTP MAIL Service ready at Mon, 27 Feb 2017 11:27:10 -0800 CLIENT -> SERVER: EHLO localhost SERVER -> CLIENT: 250-ex2013-01.ad.bcit.ca Hello [142.232.43.135]250-SIZE 36700160250-PIPELINING250-DSN250-ENHANCEDSTATUSCODES250-8BITMIME250-BINARYMIME250 CHUNKING CLIENT -> SERVER: STARTTLS SERVER -> CLIENT: 500 5.3.3 Unrecognized command SMTP ERROR: STARTTLS command failed: 500 5.3.3 Unrecognized command SMTP Error: Could not connect to SMTP host. CLIENT -> SERVER: QUIT SERVER -> CLIENT: 221 2.0.0 Service closing transmission channel 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: *anonymous

jberanek commented 7 years ago

You should add the following to your config.inc.php:

$smtp_settings['secure'] = '';

Original comment by: jberanek

jberanek commented 7 years ago

Note to MRBS developers:

I do wonder if the default configuration for SMTP email sending should be to attempt TLS even if the server doesn't advertise it though...

Original comment by: jberanek

jberanek commented 7 years ago

This could be where PHPMailer's "opportunistic TLS" along with defaulting to insecure SMTP might be appropriate.

Original comment by: jberanek

jberanek commented 7 years ago

That did it...Thanks

Original comment by: *anonymous