# This patch addresses the issue of using mimemail under PHP for Windows
#
# Background: In certain cases the Mimemail module constructs email addresses
# with the format : "Name" <address@domain.com>.  Unfortunately, the Windows 
# version of PHP cannot handle this format and causes errors.  This patch 
# allows an administrator to turn on a mimemail_simple_address variable
# that ensures that Mimemail always uses the simple form of email address
# i.e. address@domain.com.
#
# 
#
Index: modules\mimemail\includes\mimemail.admin.inc
--- modules\mimemail\includes\mimemail.admin.inc Base (BASE)
+++ modules\mimemail\includes\mimemail.admin.inc Locally Modified (Based On LOCAL)
@@ -37,6 +37,12 @@
     '#maxlength'     => 128,
     '#description'   => t('A valid e-mail address for this website, used by the auto-mailer during registration, new password requests, notifications, etc.')
   );
+  $form['mimemail']['mimemail_simple_address'] = array(
+    '#type'          => 'checkbox',
+    '#title'         => t('Simplify email addresses'),
+    '#default_value' => variable_get('mimemail_simple_address', FALSE),
+    '#description' => t('Normally, mimemail uses email addresses in the form of "name" <address@host.com>, but php running on Windows servers requires extra SMTP handling to use this format. If you are running this site on a Windows server and don\'t have an SMTP solution such as the SMTP module installed, you may need to change this option to make mimemail use the simple email format of mail@host.com for all email addresses.'),
+  );
   $form['mimemail']['mimemail_alter'] = array(
     '#type'          => 'checkbox',
     '#title'         => t('Use mime mail for all messages'),
	 
Index: modules\mimemail\mimemail.inc
--- modules\mimemail\mimemail.inc Base (BASE)
+++ modules\mimemail\mimemail.inc Locally Modified (Based On LOCAL)
@@ -560,9 +560,14 @@
         return $address['mail'];
       }
       else {
+        if (variable_get('mimemail_simple_address', FALSE)) {
+          return $address['mail'];
+        }
+        else {
         return '"'. addslashes(mime_header_encode($address['name'])) .'" <'. $address['mail'] .'>';
       }
     }
+    }
 
     // it's an array of address items
     $addresses = array();
@@ -574,8 +579,13 @@
 
   // it's a user object
   if (is_object($address) && isset($address->mail)) {
+    if (variable_get('mimemail_simple_address', FALSE)) {
+      return $address->mail;
+    }
+    else {
     return '"'. addslashes(mime_header_encode($address->name)) .'" <'. $address->mail .'>';
   }
+  }
 
   // it's formatted or unformatted string
   // TODO shouldn't assume it's valid - should try to re-parse
	 
