#230 Struggling Alot with SMTP Setup

open
None
9
2015-02-18
2011-12-31
No

Dear All,

Thanks for creating the wonderful application for the Meeting room booking system. I downloaded mentioned application and configured it as per my requirement.

As per the read me:
- Authentication
- Able to make entry (Add, Delete, Edit)

Only issue faced is related to SMTP. As per the read me it should shoot mail on every new entry, delete. But for me i am not getting that.

MRBS : 1.4.5
MySQL : For back END
Server: IIS
PHP : 5.0

Related SMTP Settings in SystemDefault.php:

/*******
* Email settings
*******/

// 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'] = TRUE; // when an entry is changed
$mail_settings['on_delete'] = TRUE; // when an entry is deleted

// 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'] = TRUE; // 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 - CHARACTER SET AND LANGUAGE
// -----------------------------------------
// You can override the charset used in emails if you like, but be sure
// the charset you choose can handle all the characters in the translation
// and that anyone may use in a booking description
//$mail_charset = "iso-8859-1";

// Set the language used for emails (choose an available lang.* file).
$mail_settings['admin_lang'] = 'en'; // Default is 'en'.

// HOW TO EMAIL - ADDRESSES
// ------------------------
// The email addresses of the MRBS administrator are set in the config file, and
// those of the room and area administrators are set though the edit_area_room.php
// in MRBS. But if you have set $mail_settings['booker'] above to TRUE, MRBS will
// need the email addresses of ordinary users. If you are using the "db"
// authentication method then MRBS will be able to get them from the users table. But
// if you are using any other authentication scheme then the following settings allow
// you to specify a domain name that will be appended to the username to produce a
// valid email address (eg "@domain.com").
$mail_settings['domain'] = '@vecv.in';
// If you use $mail_settings['domain'] above and username returned by mrbs contains extra
// strings appended like domain name ('username.domain'), you need to provide
// this extra string here so that it will be removed from the username.
$mail_settings['username_suffix'] = '';

// HOW TO EMAIL - BACKEND
// ----------------------
// Set the name of the backend used to transport your mails. Either 'mail',
// 'smtp' or 'sendmail'. Default is 'mail'.
$mail_settings['admin_backend'] = 'smtp';

/***
* Sendmail settings
*/

// Set the path of the Sendmail program (only used with "sendmail" backend).
// Default is '/usr/bin/sendmail'
$sendmail_settings['path'] = '/usr/bin/sendmail';
// Set additional Sendmail parameters (only used with "sendmail" backend).
// (example "-t -i"). Default is ''
$sendmail_settings['args'] = '';

/***
* SMTP settings
*/

// These settings are only used with the "smtp" backend"
$smtp_settings['host'] = '10.106.1.175'; // 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)

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

// Set the email address of the From field. Default is 'admin_email@your.org'
$mail_settings['from'] = 'pdoraya@vecv.in';

// 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'] = 'msaxena@vecv.in';

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

// Set to TRUE if you want the cc addresses to be appended to the to line.
// (Some email servers are configured not to send emails if the cc or bcc
// fields are set)
$mail_settings['treat_cc_as_to'] = TRUE;

// The filename to be used for iCalendar attachments. Will always have the
// extension '.ics'
$mail_settings['ics_filename'] = "booking";

// Set this to TRUE if you want MRBS to output debug information to the browser
// when you are sending email. If you are not getting emails it can be helpful
// by telling you (a) whether the mail functions are being called in the first place
//(b) whether there are addresses to send email to and (c) the result of the mail
// sending operation.
$mail_settings['debug'] = TRUE;


Can any of MRBS user can guide me about any loop holes.

We have two SMTP server at our end:
175/176 i used both of them but there will be no action.

Same thing will work properly with JAVA Mail API for Java program.

Regards,
Piyush

Discussion

  • Campbell Morrison

    Two things you should check/try:

    (1) Have you got all the mail settings before the line 'require_once "language.in'" in your coinfig file? If you have them afterwards then you will get no mail.
    (2) Have you tried using a different mail backend?

    Campbell

     
  • Piyush Doraya

    Piyush Doraya - 2011-12-31
     
  • Piyush Doraya

    Piyush Doraya - 2011-12-31

    Config File with settings

     
  • Piyush Doraya

    Piyush Doraya - 2011-12-31

    Mentioned actions doesn't seems to be working for me.

    Attaching the config and areadefault files in thread for your view kindly check and provide your view.

    I checked with two SMTP host but for both its not working

     
  • Campbell Morrison

    What happens if you use the 'mail' backend instead of 'smtp'?

    Campbell

     
  • Piyush Doraya

    Piyush Doraya - 2011-12-31

    same observation!

    Can you brief the significance of 'Mail' also and how it get configured.

    Actually using windows os and IIS as web server. Is it require some special hadling for SMTP.

    I attached modified file for your reference.

     
  • Campbell Morrison

    The 'mail' backend uses the PHP mail() function.

    Yoiu say that you are using MRBS 1.4.5. However your config file settings come from a later release. Are you sure you are using 1.4.5?

    Campbell

     
  • Piyush Doraya

    Piyush Doraya - 2011-12-31

    Sorry for confusion, Actually i downloaded MRBS 1.4.7 version.

    Even if i will try to modify the mail.php it should get work i guess.

    i.e. I need to provide all those

    host name
    Port name
    auth details and all.

     
  • Piyush Doraya

    Piyush Doraya - 2012-01-02

    Dear Morrison,

    Do you have some comment on the open issue. Since i am novice in PHP so not much comfortable in PHP code.

    Regards,
    Piyush

     
  • Campbell Morrison

    You have got $mail_settings['debug'] = TRUE; (which is good). Are you getting any debug output?

    Campbell

     
  • Piyush Doraya

    Piyush Doraya - 2012-01-03

    There will be no logs printed on browser for the same.

     
  • Campbell Morrison

    At the beginning of edit_entry_handler.php, at line 7, after the three "require_once" statemenrs, can you insert the following line

    echo var_dump($need_to_send_mail);

    and let me know the results

    Thanks,

    Campbell

     
  • Piyush Doraya

    Piyush Doraya - 2012-01-04

    Those settings also doesn't seems to be working.
    Is it issue with Firewall or Antivirus related?

     
  • Campbell Morrison

    No, that line won't make it work, but will produce some debugging output that will give me a clue as to what's going wrong.

    You should get some debug output along the lines of
    (bool) true or
    (bool) false

    Campbell

     
  • Campbell Morrison

    Just wondering if you managed to get that debug output so that we can work out what's going wrong?

    Campbell

     
  • Piyush Doraya

    Piyush Doraya - 2012-02-01

    Sorry for delayed response! Actually i was working with IT team to check any issue but they are also not sure about that.

    Could you tell me which part it will put the debug statement? On browser its not showing anything.

    Thanks in advance

     
  • Campbell Morrison

    Yes, it will appear in the browser after you press Save on making a booking. Are you sure you've inserted that line, and uploaded it to your webserver? You should get some output.

    Campbell

     
  • Roeseler

    Roeseler - 2012-06-13

    Hello.

    Did you manage to solve the problem?
    I am facing the same issue.
    I did all the steps you mentioned before and I am able to see the debug:
    bool(true) [DEBUG] Preparing email for new or changed booking ...
    [DEBUG] Preparing to send email ...
    [DEBUG] Using backend 'smtp'
    [DEBUG] Recipients: 'support@mydomain.pt,roeseler@mydomain.pt'

    But no email is sent....
    I have a windows 2008 server with IIS7 and also SMTP Virtual Server configured in IIS 6.0 Manager, working ok because other web sites are using it and sending emails.

    How can I force mrbs to use it?
    I already tried 'mail' backend instead of 'smtp' but without success.

    Nothing shows on windows logs.

    Thanks in advance for your help.

    PS: I would like to attach a file with my configurations but can't seem find the place to do it... :s

    regards,
    Pedro Röseler

     
  • Roeseler

    Roeseler - 2012-06-14

    Hello again!

    Good news! It is now working!
    I tried all the different options once again and everything works now.

    Here are my settings, in case someone has the same problem:

    // HOW TO EMAIL - ADDRESSES
    // ------------------------
    // The email addresses of the MRBS administrator are set in the config file, and
    // those of the room and area administrators are set though the edit_area_room.php
    // in MRBS. But if you have set $mail_settings['booker'] above to TRUE, MRBS will
    // need the email addresses of ordinary users. If you are using the "db"
    // authentication method then MRBS will be able to get them from the users table. But
    // if you are using any other authentication scheme then the following settings allow
    // you to specify a domain name that will be appended to the username to produce a
    // valid email address (eg "@domain.com").
    $mail_settings['domain'] = '@mydomain';
    // If you use $mail_settings['domain'] above and username returned by mrbs contains extra
    // strings appended like domain name ('username.domain'), you need to provide
    // this extra string here so that it will be removed from the username.
    $mail_settings['username_suffix'] = '@mydomain';

    // HOW TO EMAIL - BACKEND
    // ----------------------
    // Set the name of the backend used to transport your mails. Either 'mail',
    // 'smtp' or 'sendmail'. Default is 'mail'.
    $mail_settings['admin_backend'] = 'mail';

    /***
    * Sendmail settings
    */

    // Set the path of the Sendmail program (only used with "sendmail" backend).
    // Default is '/usr/bin/sendmail'
    $sendmail_settings['path'] = '/usr/bin/sendmail';
    // Set additional Sendmail parameters (only used with "sendmail" backend).
    // (example "-t -i"). Default is ''
    $sendmail_settings['args'] = '';

    /***
    * SMTP settings
    */

    // These settings are only used with the "smtp" backend"
    $smtp_settings['host'] = 'mail.mydomain; // SMTP server
    $smtp_settings['port'] = 465; // 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)

    Regards,
    Pedro Röseler

     
  • Roeseler

    Roeseler - 2012-06-14

    And a final note!!!

    I just found out why emails where not being sent! It had nothing to do with the email settings, the problem was the account I was using to test it!
    Since the account I was using in mrbs did not exist in our email server, the emails were being rejected! Which makes perfectly sense....
    Hope it helps someone!

    Cheers!

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2013-01-17

    That was very helpful, thanks

     
  • Roeseler

    Roeseler - 2013-01-17
     
    Last edit: Roeseler 2013-01-17


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks