Index: mailattach.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mailattach/mailattach.module,v
retrieving revision 1.2
diff -u -p -r1.2 mailattach.module
--- mailattach.module	23 May 2007 21:50:18 -0000	1.2
+++ mailattach.module	20 Dec 2007 16:10:21 -0000
@@ -241,7 +241,7 @@ function mailattach_mail_page_submit($fo
   // we check for attachments
   do{
     $files = file_check_upload('file'.$fileFields++) ? TRUE : FALSE;
-  }while(!$files && $fileFields <= 3);
+  }while(!$files && $fileFields <= variable_get('mailattach_attachment_fields', 3));
 
   if($files){
     $trenner  = md5(uniqid(time()));
@@ -250,7 +250,7 @@ function mailattach_mail_page_submit($fo
     $message .= "Content-Type: text/plain; charset=UTF-8; format=flowed;"."\n\n"; // sets the mime type
     $message .= $body."\n";
     $message .= "\n\n";
-    for($i=1;$i<=3;$i++){
+    for($i=1;$i<=variable_get('mailattach_attachment_fields', 3);$i++){
       $file = file_check_upload('file'.$i);
       if($file->filename){
         $file->filepath = str_replace("\\","\\\\",$file->filepath);
