meeting-room-booking-system / mrbs-code

MRBS application code
Other
124 stars 61 forks source link

email send not working #1165

Open jberanek opened 10 years ago

jberanek commented 10 years ago

i want to send a email to the room owner on a new booking. i use sendmail. when i try a test script for sendmail then it works: $empfaenger = "mail@domainname.de"; $betreff = "Test des Mailversand"; $text = "Der Test scheint geklappt zu haben"; $extra = "From: Info info@domainname.de\r\n"; if(mail($empfaenger, $betreff, $text, $extra)) { echo 'E-Mail versendet'; }

But mrbs does not send mails on a new booking. whats wrong?

in systemdefaults i have: $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'] = TRUE; // the room administrator $mail_settings['booker'] = FALSE; // the person making the booking $mail_settings['book_admin_on_approval'] = FALSE; // the booking administrator when booki...

$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

$mail_settings['details'] = TRUE; // Set to TRUE if you want full booking details; $mail_settings['html'] = TRUE; // Set to true if you want HTML mail $mail_settings['icalendar'] = FALSE; // Set to TRUE to include iCalendar details

$mail_settings['admin_lang'] = 'de'; // Default is 'en'.

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

$sendmail_settings['path'] = '/usr/sbin/sendmail'; // checked with phpinfo!

Reported by: *anonymous

Original Ticket: mrbs/support-requests/429

jberanek commented 10 years ago

the email of the room owner is set in the room by room_admin_email correctly

Original comment by: *anonymous

jberanek commented 10 years ago

No help? in the functions_mail.inc is this part not work: // Call to the PEAR::Mail class $mail_object =& Mail::factory($backend, $params); $result = $mail_object->send($recipients, $mime['headers'], $mime['body']);

currently i removed this lines an have made my own sendmail part: $header = 'From: info@example.com' . "\r\n" . 'Reply-To: info@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
$result = mail($recipients, $subject, $text_body['content'], $header); This works fine.

but i would be more happy if someone can help me to solve the main problem. thx

Original comment by: *anonymous

jberanek commented 10 years ago

What versions of MRBS and PHP are you using?

Campbell

Original comment by: campbell-m

jberanek commented 10 years ago

Your code uses the mail() command, thereby using PHP's built-in mail routines, but you've configured MRBS to use the sendmail backend. What's your reasoning behind that?

It would be more equivalent if you had:

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

Original comment by: jberanek

jberanek commented 10 years ago

HI

check the logs and identify the service which used to send mail while booking (posffix/sendmail)

i faced same issue and i used postfix instead of sendmail with relayhost added on main.cf

Regards, Ben

Original comment by: *anonymous