Menu

#794 Gmail settings are not working for me, please assist .

open
nobody
None
1
2015-11-06
2015-09-25
No

I have configured emails in my config file as below but i only received a notification email from gmail that untrusted application wanted to use my account and has been blocked. eversince i did not get any reply for emails being send.

My Config file lookes like this...(RED edited entry)

// 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'] = TRUE; // 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)

// 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

// 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'] = FALSE; // 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 - LANGUAGE
// -----------------------------------------

// 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'] = '';
// 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'] = 'ssl://smtp.gmail.com'; // SMTP server
$smtp_settings['port'] = 465; // SMTP port number
$smtp_settings['auth'] = TRUE; // Whether to use SMTP authentication
$smtp_settings['username'] = 'xXxx@gmail.com'; // Username (if using authentication)
$smtp_settings['password'] = 'xxxxxxxxx'; // Password (if using authentication)

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

// Set the email address of the From field. Default is 'admin_email@your.org'
$mail_settings['from'] = 'xxxx@gmail.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'] = 'xxxxx@gmail.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'] = 'xxxxx@gmail.com';

// 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'] = FALSE;

// 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'] = FALSE;
// Set this to TRUE if you do not want any email sent, whatever the rest of the settings.
// This is a global setting that will override anything else. Useful when testing MRBS.
$mail_settings['disabled'] = FALSE;

Discussion

  • John Beranek

    John Beranek - 2015-09-25

    The settings I use are:

    $smtp_settings['host'] = 'smtp.gmail.com';  // 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'] = 'USERNAME@gmail.com';       // Username (if using authentication)
    $smtp_settings['password'] = 'PASSWORD';       // Password (if using authentication)
    
     
    • Samuel Nhlapo 1

      Samuel Nhlapo 1 - 2015-09-29

      Hi John than you very much for the settings, i am still struggling and i belief is with my configurations this time. if you can have chance, i have created testing gmailaccount below which i would be glad if you can test my attached config file.Username: ultimatemrbs@gmail.com, password:Ultimate123.

      Background:
      In the begining, i had to manually copy libeay32.dll and ssleay.dll because they were missing in wamp/bin/php/php5.5.12/ext.

       

      Last edit: Samuel Nhlapo 1 2015-09-29
  • Samuel Nhlapo 1

    Samuel Nhlapo 1 - 2015-09-30

    hi everybody, i have posted my gmail test acoount and would be glad to here if is working for somebody out there. Is it possible not to use smtp to send email, has anybody managed to?

     
  • Campbell Morrison

    Yes, I have just tested it and it works for me (I have since deleted the sent mail from the Sent folder). I was using SSL as above. I did the test from MRBS running on my own server. I cannot use SMTP from my hosted account, but I suspect that's because the hosting provider blocks SMTP traffic.

    You could trying using the 'mail' backend instead of 'smtp'.

     
  • Samuel Nhlapo 1

    Samuel Nhlapo 1 - 2015-09-30

    Thanks Campbell, i was using corporate network, maybe your correct, i will try it on my personal network..cheers

     
  • John Beranek

    John Beranek - 2015-09-30

    Many corporate networks will block outbound SMTP, including ports 25, 465, 587...