Index: /trunk/include/functions_mail.inc.php
===================================================================
--- /trunk/include/functions_mail.inc.php	(revision 6411)
+++ /trunk/include/functions_mail.inc.php	(revision 6706)
@@ -761,20 +761,21 @@
       }
     }
+
     foreach ($selectors as $selector => $style)
     {
       if (!preg_match('/^(#|\.|)([A-Za-z0-9_-]*)$/', $selector, $matches))
       {
-        $unknow_selectors .= $selector.' {'.implode('; ', $style).";}\n";
+        $unknow_selectors .= $selector.' {'.implode(";\n", $style).";}\n";
       }
       else switch ($matches[1])
       {
         case '#':
-          $content = preg_replace('|id="'.$matches[2].'"|', 'id="'.$matches[2].'" style="'.implode('; ', $style).';"', $content);
+          $content = preg_replace('|id="'.$matches[2].'"|', 'id="'.$matches[2].'" style="'.implode(";\n", $style).";\"\n", $content);
           break;
         case '.':
-          $content = preg_replace('|class="'.$matches[2].'"|', 'class="'.$matches[2].'" style="'.implode('; ', $style).';"', $content);
+          $content = preg_replace('|class="'.$matches[2].'"|', 'class="'.$matches[2].'" style="'.implode(";\n", $style).";\"\n", $content);
           break;
         default:
-          $content = preg_replace('#<'.$matches[2].'( |>)#', '<'.$matches[2].' style="'.implode('; ', $style).';"$1', $content);
+          $content = preg_replace('#<'.$matches[2].'( |>)#', '<'.$matches[2].' style="'.implode(";\n", $style).";\"\n$1", $content);
           break;
       }
