--- messaging_mime_mail/messaging_mime_mail.module	Wed May 13 12:23:42 2009
+++ messaging_mime_mail/messaging_mime_mail.module	Wed May 13 12:04:19 2009
@@ -39,7 +39,7 @@
   // Get parameters without invoking hook_mail_alter()
   $mail = messaging_mail_prepare($destination, $message, $params, FALSE);
   // mimemail($sender, $recipient, $subject, $body, $plaintext = NULL, $headers = array(), $text = NULL, $attachments = array(), $mailkey = '')  
-  return mimemail($mail['from'], $mail['to'], $mail['subject'], $mail['body'], NULL, $mail['headers'], NULL, array(), '');
+  return mimemail($mail['from'], $mail['to'], $mail['subject'], $mail['body'], NULL, $mail['headers'], NULL, $mail['attachments'], '');
 }
 
 /**
--- messaging_phpmailer/messaging_phpmailer.module	Wed May 13 12:23:43 2009
+++ messaging_phpmailer/messaging_phpmailer.module	Wed May 13 12:19:58 2009
@@ -41,6 +41,7 @@
         'glue' => "<br>", // don't use <br/> nor <br /> for maximum HTML email client compatibility
         'footer' => "<br><br>--",
         'description' => t('Send HTML e-mails using PHPMailer'),
+        'attachments' => 1,
       );
       return $info;
   }
@@ -62,6 +63,12 @@
       '#default_value' => variable_get('messaging_phpmailer_debug', 0),
       '#description' => t('If enabled, PHPMailer debugging will be activated and all messages logged to watchdog.')
   );
+  $form['messaging_phpmailer_attach'] = array(
+      '#title' => t('Include attachments'),
+      '#type' => 'checkbox',
+      '#default_value' => variable_get('messaging_phpmailer_attach', 0),
+      '#description' => t('If enabled, PHPMailer will include attachments with outgoing messages.')
+  );
   return system_settings_form($form);
 }
 
@@ -140,6 +147,13 @@
   $mail->Subject = $subject;
   $mail->Body = str_replace("\r", '', $body);
   
+  
+  if(!empty($message['attachments']) && variable_get('messaging_phpmailer_attach', 0)){
+    foreach($message['attachments'] as $attachment) {
+      $mail->AddAttachment($attachment->filepath, $attachment->filename, 'base64', $attachment->filemime);
+    }
+  }
+
   // If enabled debug option, log everything...
   if (variable_get('messaging_phpmailer_debug', 0)) {
     $mail->SMTPDebug = TRUE;
--- messaging.mail.inc	Wed May 13 12:23:43 2009
+++ messaging.mail.inc	Fri May 08 11:16:42 2009
@@ -48,6 +48,7 @@
     'subject'  => $message->subject,
     'body'     => $message->body,
     'headers'  => messaging_mail_headers($message, $params),
+    'attachments' => $message->attachments,
   );  
   
   // Invoke hook_mail_alter() to allow all modules to alter the resulting e-mail.
