Revision: 1253
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1253&view=rev
Author:   cimorrison
Date:     2009-11-11 00:01:38 +0000 (Wed, 11 Nov 2009)

Log Message:
-----------
Introduced a new mail setting $mail_settings['treat_cc_as_to'] that puts the 
'cc' recipients on the 'to' line instead of on the 'cc' line.   Useful for 
those whose hosting companies have configured their mail servers not to send 
out emails if the cc or bcc fields are set.

Modified Paths:
--------------
    mrbs/branches/provisional_bookings/web/functions_mail.inc
    mrbs/branches/provisional_bookings/web/systemdefaults.inc.php

Modified: mrbs/branches/provisional_bookings/web/functions_mail.inc
===================================================================
--- mrbs/branches/provisional_bookings/web/functions_mail.inc   2009-11-10 
23:11:44 UTC (rev 1252)
+++ mrbs/branches/provisional_bookings/web/functions_mail.inc   2009-11-11 
00:01:38 UTC (rev 1253)
@@ -863,6 +863,17 @@
   
   global $mail_settings, $sendmail_settings, $smtp_settings;
   
+  // for cases where the mail server refuses
+  // to send emails with cc or bcc set, put the cc
+  // addresses on the to line
+  if (isset($cc) && $mail_settings['treat_cc_as_to'])
+  {
+    $recipients_array = array_merge(explode(',', $recipients),
+                                    explode(',', $cc));
+    $recipients = get_address_list($recipients_array);
+    $cc = NULL;
+  }
+  
   // Set up configuration settings
   $from = $mail_settings['from'];
   $backend = $mail_settings['admin_backend'];

Modified: mrbs/branches/provisional_bookings/web/systemdefaults.inc.php
===================================================================
--- mrbs/branches/provisional_bookings/web/systemdefaults.inc.php       
2009-11-10 23:11:44 UTC (rev 1252)
+++ mrbs/branches/provisional_bookings/web/systemdefaults.inc.php       
2009-11-11 00:01:38 UTC (rev 1253)
@@ -645,6 +645,11 @@
 // 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;
+
 /**********
  * Language
  **********/


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to