--- messaging_phpmailer/messaging_phpmailer.module	Fri Apr 24 06:27:50 2009
+++ messaging_phpmailer/messaging_phpmailer.module	Tue May 12 17:53:17 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 $attach_object) {
+      $mail->AddAttachment($attach_object['filepath'], $attach_object['filename'], 'base64', $attach_object['filemime']);
+    }
+  }
+
   // If enabled debug option, log everything...
   if (variable_get('messaging_phpmailer_debug', 0)) {
     $mail->SMTPDebug = TRUE;
--- messaging.mail.inc	Wed Apr 29 18:41:59 2009
+++ messaging.mail.inc	Wed Apr 29 18:41:32 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.
