--- old\simplenews\includes\simplenews.mail.inc
+++ new\simplenews\includes\simplenews.mail.inc
@@ -43,25 +43,44 @@
     $sent_subscriber_count = 0;
     if (empty($accounts)) {
       // No accounts specified.  Write all active subscriber addresses to mail spool.
-      db_query('
-        INSERT INTO {simplenews_mail_spool}
-        (mail, nid, vid, tid, status, timestamp)
-        SELECT s.mail, %d, %d, t.tid, %d, %d
+      $tids = array();
+      $tids[$node->simplenews['tid']] = $node->simplenews['tid'];
+      foreach($node->taxonomy AS $tid => $data) {
+        $tids[$data->tid] = $data->tid;
+      }
+      $results = db_query('
+        SELECT s.mail, t.tid
         FROM {simplenews_subscriptions} s
         INNER JOIN {simplenews_snid_tid} t
           ON s.snid = t.snid
         WHERE s.activated = 1
-          AND t.tid = %d
-          AND t.status = %d',
+          AND t.tid IN ('.implode(',', $tids).')
+          AND t.status = %d
+        ORDER BY s.mail, t.tid',
+        SIMPLENEWS_SUBSCRIPTION_STATUS_SUBSCRIBED
+      );
+      $addresses = array();
+      while ($addres = db_fetch_object($results)) {
+        $addresses[$addres->mail] = $addres->tid;
+      }
+      $sent_subscriber_count = 0;
+      $time = time();
+      // remove double asdresses (with more tids)
+      foreach($addresses AS $mailaddres => $mailtid) {
+        db_query("
+          INSERT INTO {simplenews_mail_spool}
+            (mail, nid, vid, tid, status, timestamp)
+          VALUES ('%s', %d, %d, %d, %d, %d)",
+            $mailaddres,
         $node->nid,
         $node->vid,
+            $mailtid,
         SIMPLENEWS_SPOOL_PENDING,
-        time(),
-        $node->simplenews['tid'],
-        SIMPLENEWS_SUBSCRIPTION_STATUS_SUBSCRIBED
+            $time
       );
-      $sent_subscriber_count = db_affected_rows();
+        $sent_subscriber_count += 1;
     }
+    }
     else {
       // Get email address of specified accounts.
       foreach ($accounts as $account) {
@@ -189,10 +208,17 @@
   }
 
   if (is_object($node)) {
+    // Set the tid to use on top.
+    if (!empty($params['context']['account']->tids)) {
+      rsort($params['context']['account']->tids);
+      foreach($params['context']['account']->tids AS $tid) {
+        $node->simplenews['tid'] = $tid;
+        break;
+      }
+    }
     $params['from'] = _simplenews_set_from($node);
     $params['context']['newsletter'] = taxonomy_get_term($node->simplenews['tid']);
     $params['context']['node'] = $node;

     // Send mail
     if (module_exists('mimemail')) {
       // If mimemail module is installed ALL emails are send via this module.
