--- forward.module	2006-12-07 23:40:44.000000000 -0800
+++ forward-new.module	2006-12-07 23:12:42.000000000 -0800
@@ -122,6 +122,14 @@
     '#options' => array('1' => '1', '5' => '5', '10' => '10', '15' => '15', '20' => '20', '25' => '25', '30' => '30', '35' => '35', '40' => '40', '50' => '50'),
     '#description' => t("How many times a user can use the form in a one hour period. This will help prevent the forward module from being used for spamming."),
   );
+  $form['forward_options']['forward_recipient_flood_control'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Maximum Number of Recipients'),
+    '#default_value' => variable_get('forward_recipient_flood_control', 5),
+    '#size' => 3,
+    '#maxlength' => 2,
+    '#description' => t("Maximum number of email recipients per delivery."),
+  );
   $form['forward_options']['forward_flood_error'] = array(
     '#type' => 'textarea',
     '#title' => t('Flood Control Error'),
@@ -324,7 +332,7 @@
       '#default_value' => str_replace(', ', '\n', $recipients),
       '#cols' => 50,
       '#rows' => 5,
-      '#description' => t('Enter multiple addresses on separate lines or separate them with commas.'),
+      '#description' => t('Enter multiple addresses on separate lines or separate them with commas (up to a maximum of %d).',array('%d' => variable_get('forward_recipient_flood_control', 5))),
       '#attributes' => NULL,
       '#required' => TRUE,
     );
@@ -488,6 +496,7 @@
   $recipients = str_replace(array("\r\n", "\n", "\r"), ', ', $recipients);
   $recipients = str_replace(',', ', ', $recipients);
   $recipients = str_replace(',  ', ', ', $recipients);
+  $recipientsLimit = variable_get('forward_recipient_flood_control', 5);
 
   // convert addresses to an array
   $recipient_addresses = explode(', ', $recipients);
@@ -510,6 +519,11 @@
   if ($recipients == '') {
     form_set_error('recipients', t('You did not enter any recipients.'));
   }
+  // check for max number of recipients per any send event
+  if (count($recipient_addresses) > $recipientsLimit)
+  {
+  	 form_set_error('recipients', t('You entered more than the maximum number ('.$recipientsLimit.') of recipients allowed.'));
+  }
   else {
     foreach ($recipient_addresses as $address) {
       if ((user_validate_mail($address)) && ($address != '')) {
@@ -587,7 +601,18 @@
 
   $headers = "From: ".$edit['yemail']."\n";
   $headers .= "MIME-Version: 1.0\n";
-  $headers .= "Content-type: text/html; charset=utf-8\n";
+  //$headers .= "Content-type: text/html; charset=utf-8\n";
+  $headers .= 'Content-Type: multipart/alternative;
+	boundary="----=NextMime00A_000_893263890D"
+
+This is a multi-part message in MIME format.
+
+------=NextMime00A_000_893263890D
+Content-Type: text/plain;
+	charset="utf-8"
+Content-Transfer-Encoding: quoted-printable
+
+';
 
   $recipients = trim($edit['recipients']);
   $recipients = str_replace(array("\r\n", "\n", "\r"), ', ', $recipients);
