meeting-room-booking-system / mrbs-code

MRBS application code
Other
124 stars 61 forks source link

problem about e-mail setting #1487

Open jberanek opened 9 years ago

jberanek commented 9 years ago

Hi,MRBS group

Thank you for providing this wonderful meeting room booking system. I am using it for our group for ordering meeting room. We would like this system has the ability to send e-mail to admin once a new entry is added/modified/deleted. I have a problem to configure the e-mail setting. For example,in my config.ini.php, I want to use mis_BookRoom@163.com to send e-mail to admin's e-mail address linyiqi2015@163.com. Until now ,it doesn't work. Could you help me? Thank you in advanced.

$mrbs_admin_email = "mis_BookRoom@163.com"; $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'] = TRUE; $mail_settings['on_new'] = TRUE; $mail_settings['on_change'] = TRUE; $mail_settings['on_delete'] = TRUE; $mail_settings['details'] = TRUE; $mail_settings['html'] = FALSE; $mail_settings['icalendar'] = FALSE;

$smtp_settings['host'] = 'smtp.163.com'; // SMTP server $smtp_settings['port'] = 25; // SMTP port number $smtp_settings['auth'] = TRUE; // Whether to use SMTP authentication $smtp_settings['username'] = 'mis_BookRoom'; // Username (if using authentication) $smtp_settings['password'] = '***'; // Password (if using authentication)

// EMAIL - MISCELLANEOUS // ---------------------

// Set the email address of the From field. Default is 'admin_email@your.org' $mail_settings['from'] = 'mis_BookRoom@163.com';

// 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. $mail_settings['organizer'] = 'mis_BookRoom@163.com';

// 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'] = 'linyiqi2015@163.com';

// Set email address of the Carbon Copy field. Default is ''. You can define // more than one recipient (see 'recipients') $mail_settings['cc'] = '';

$mail_settings['treat_cc_as_to'] = FALSE;

$mail_settings['ics_filename'] = "booking";

$mail_settings['debug'] = FALSE;

$mail_settings['disabled'] = FALSE;

Reported by: *anonymous

Original Ticket: mrbs/support-requests/759

jberanek commented 9 years ago

Try setting

$mail_settings['debug'] = TRUE;

and see what ouput you get.

Original comment by: campbell-m

jberanek commented 9 years ago

Hi Cambell,

Thank you for your reply so quickly. I changed $mail_settings['debug'] to be true. After I added a new entry, the browser showed as follows: [DEBUG] Preparing email for new or changed booking ... [DEBUG] Preparing to send email ... [DEBUG] Using backend 'smtp.163.com' [DEBUG] Recipients: 'linyiqi2015@163.com,mis_BookRoom@163.com,easy-going1983@163.com,@163.com'

None of them has received a e-mail. I have no idea to fix it. Could you help me follow up? Thank you again.

Attached, e-mail setting part of new config.ini.php file. Please check it out.

Original comment by: *anonymous

Attachments: https://sourceforge.net/p/mrbs/support-requests/_discuss/thread/3276afd2/b667/attachment/config.txt

jberanek commented 9 years ago

It looks like you have $mail_settings['admin_backend'] set to 'smtp.163.com'. It should be set to just 'smtp'.

Original comment by: campbell-m

jberanek commented 9 years ago

I am having the exact same problem, except with gmail... Here is the debug:

[DEBUG] Preparing email for new or changed booking ... [DEBUG] Preparing to send email ... [DEBUG] Using backend 'smtp' [DEBUG] Recipients: 'malone.dunlavy@vintagechurchla.com,archive@vintag echurchla.com'

Also: excerpt from config.inc.php:

$mail_settings['admin_on_bookings'] = FALSE;
$mail_settings['area_admin_on_bookings'] = FALSE; 
$mail_settings['room_admin_on_bookings'] = FALSE; 
$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'] = FALSE;

$mail_settings['html'] = TRUE;
$mail_settings['icalendar'] = TRUE; 

$mail_settings['admin_lang'] = 'en'; 

$mail_settings['domain'] = '@vintagechurchla.com';
$mail_settings['username_suffix'] = '';

$mail_settings['admin_backend'] = 'smtp';

$smtp_settings['host'] = 'smtp.gmail.com'; 
$smtp_settings['port'] = 465; 
$smtp_settings['auth'] = TRUE; 
$smtp_settings['username'] = 'malone.dunlavy@vintagechurchla.com'; 
$smtp_settings['password'] = '*************************'; 

$mail_settings['from'] = 'contact@vintagechurchla.com';
$mail_settings['organizer'] = 'contact@vintagechurchla.com';
$mail_settings['recipients'] = 'malone.dunlavy@vintagechurchla.com';
$mail_settings['cc'] = 'archive@vintagechurchla.com';
$mail_settings['treat_cc_as_to'] = TRUE;
$mail_settings['ics_filename'] = "VintageCal";
$mail_settings['debug'] = TRUE;
$mail_settings['disabled'] = FALSE;

Original comment by: *anonymous

jberanek commented 9 years ago

Thanks for your help! I have a question about your e-mail username. $smtp_settings['username'] = 'malone.dunlavy@vintagechurchla.com'; $smtp_settings['password'] = '***'; Is this malone.dunlavy@vintagechurchla.com a gmail account?

Original comment by: *anonymous

jberanek commented 9 years ago

Thank you again. I tried to set $mail_settings['admin_backend'] to "smtp".

In my server (I deploy mrbs system into Internet Information Server in this computer), if I open add entry page and click save button, the browser shows wait for ****.xmu.edu.cn reponse. For a long time, it will show as followings: [DEBUG] Preparing email for new or changed booking ... [DEBUG] Preparing to send email ... [DEBUG] Using backend 'smtp' [DEBUG] Recipients: 'linyiqi2015@163.com,mis_BookRoom@163.com,alice@163.com'

In other computer, if I open add entry page and click save button, it will say server error 500. Do I need to set the SMTP service in the server?

I still don't receive any e-mail.

Original comment by: *anonymous

jberanek commented 9 years ago

Where are you hosting MRBS? Is there potentially a firewall between this machine and smtp.163.com which could be blocking SMTP traffic?

Original comment by: jberanek

jberanek commented 9 years ago

Try also using a different backend, eg 'mail', to see if that works.

Also, I've always used

$smtp_settings['host'] = 'ssl://smtp.gmail.com';  // ie with the 'ssl://'

I don't know if that makes a difference.

Original comment by: campbell-m

jberanek commented 9 years ago

Hi John, MRBS is being hosting on a computer that has windows server 2008. Thank you for your reminder. I just check the firewall and close it. It still takes a long time to implement the "save" function (about 5 minutes) on add entry page and then browser shows the same.

Original comment by: *anonymous

jberanek commented 9 years ago

On your other computer what's the error message that you are getting in your PHP error log?

Original comment by: campbell-m

jberanek commented 9 years ago

Solved:

Login to your google admin account. go to the admin console. Go to Apps>Google Apps>Gmail>Advanced Settings. Scroll until you find smtp-relay settings. Configure these with your static IP address and choose whether you want to use smtp authentication. Then in MRBS config.inc.php, host: smtp-relay.gmail.com port: 25 (port may change if you use authentication, see:https://support.google.com/a/answer/176600?hl=en)

Boom, worked immediately for me.

Original comment by: mdunlavy

Attachments: https://sourceforge.net/p/mrbs/support-requests/_discuss/thread/3276afd2/34e6/attachment/Screen%20Shot%202015-07-15%20at%209.07.35%20AM.png

jberanek commented 9 years ago

Hi Malone,Thank you for your reminder. I can't use gmail in China.

Original comment by: *anonymous

jberanek commented 9 years ago

Hi Campbell, I still can not solve this problem. I tried to write a simple php program to send e-mail and it works. I use these two e-mail addresses in mrbs and it doesn't work. So I think it may not be smtp setting of e-mail.

I use Chrome F12 function to trace the edit_entry.php page. When I click save button on edit_entry.php page, the Chrome browser shows that edit_entry_handler.php has been pending for a long time and then finally it's status is 500 as attachment showed. Thank you so much for your time.

Original comment by: *anonymous

Attachments: https://sourceforge.net/p/mrbs/support-requests/_discuss/thread/3276afd2/9e44/3b43/attachment/error.jpg

jberanek commented 9 years ago

为什么我的配置不起作用?

Original comment by: *anonymous